Skip to content

gh-105716 breaks greenlet/eventlet #112826

Closed

Description

@doko42

Bug report

Bug description:

gh-105716 breaks greenlet/eventlet, which apparently was working with the 3.12.0 release.
this is greenlet 3.0.1, plus eventlet 0.33.3 plus the python3.12 for eventlet taken from
https://src.fedoraproject.org/rpms/python-eventlet/tree/rawhide

Traceback (most recent call last):
  File "/home/packages/12/python-eventlet-0.33.3/tests/isolated/patcher_existing_locks_late.py", line 20, in <module>
    eventlet.monkey_patch()
  File "/home/packages/12/python-eventlet-0.33.3/eventlet/patcher.py", line 294, in monkey_patch
    modules_to_patch += modules_function()
                        ^^^^^^^^^^^^^^^^^^
  File "/home/packages/12/python-eventlet-0.33.3/eventlet/patcher.py", line 480, in _green_thread_modules
    from eventlet.green import threading
  File "/home/packages/12/python-eventlet-0.33.3/eventlet/green/threading.py", line 22, in <module>
    eventlet.patcher.inject(
  File "/home/packages/12/python-eventlet-0.33.3/eventlet/patcher.py", line 109, in inject
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/threading.py", line 40, in <module>
    _is_main_interpreter = _thread._is_main_interpreter
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'eventlet.green.thread' has no attribute '_is_main_interpreter'

---
FAIL

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    type-bug
    on Dec 7, 2023
  2. ericsnowcurrently commented on Dec 7, 2023

    @ericsnowcurrently
    Member

    Thanks for bringing this to my attention. I'll take a look.

  3. ericsnowcurrently commented on Dec 7, 2023

    @ericsnowcurrently
    Member

    FTR:

    original PR: gh-112661
    3.12 backport: gh-110707

  4. ericsnowcurrently commented on Dec 7, 2023

    @ericsnowcurrently
    Member

    @Yhg1s, should this block 3.12.1? I expect to have a fix up shortly.

  5. added
    3.12
    3.13
    on Dec 7, 2023
  6. ericsnowcurrently commented on Dec 7, 2023

    @ericsnowcurrently
    Member

    To be clear, I am not planning on any actual fix in main (3.13+). There will only be a "What's New" entry. If an app or library is replacing the _thread module then they already know they need to provide everything the stdlib module does, including the "private" attributes (especially those used by threading). This seems like a fairly rare case so I'm okay with helping any such libraries with their fixes.

    (The situation is different for 3.12, where 3.12.0 was already released and the change in gh-110707 introduced a regression. Thus a fix was needed for 3.12.1.)

    In addition to the 3.12 fix, I'm planning on making sure gevent/eventlet gets fixed upstream.

  7. added a commit that references this issue on Dec 7, 2023
  8. added a commit that references this issue on Dec 7, 2023
  9. Eclips4 commented on Dec 8, 2023

    @Eclips4
    Member

    Thanks for the fix Eric!

  10. added a commit that references this issue on Feb 11, 2024
  11. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.123.13release-blockertopic-subinterpreterstype-bug

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions