Skip to content

Python 3.13: AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread' #964

@musicinmybrain

Description

@musicinmybrain

On Python 3.13, there are several errors in test collection due to AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'.

To reproduce:

$ gh repo clone eventlet/eventlet
$ python3.13 -V
Python 3.13.0b1
$ tox -e py313
[…]
Failed to build greenlet

So we need to build a version of greenlet that supports Python 3.13, using python-greenlet/greenlet#396:

$ . .tox/py313/bin/activate
(py313) $ cd ..
(py313) $ gh repo clone python-greenlet/greenlet
(py313) $ git remote add vstinner https://github.com/vstinner/greenlet.git
(py313) $ git fetch --all
(py313) $ git checkout py313
(py313) $ pip install -e .
(py313) $ cd ../eventlet
(py313) $ deactivate

Now we can try again:

$ tox -e py313
==================================================================================================== ERRORS ====================================================================================================
____________________________________________________________________________________ ERROR collecting tests/asyncio_test.py ____________________________________________________________________________________
tests/asyncio_test.py:18: in <module>
    from .wsgi_test import _TestBase, Site
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.tox/py313/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
tests/wsgi_test.py:21: in <module>
    from eventlet import wsgi
eventlet/wsgi.py:14: in <module>
    from eventlet.green import BaseHTTPServer
eventlet/green/BaseHTTPServer.py:3: in <module>
    from eventlet.green import SocketServer
eventlet/green/SocketServer.py:5: in <module>
    from eventlet.green import threading
eventlet/green/threading.py:18: in <module>
    eventlet.patcher.inject(
eventlet/patcher.py:109: in inject
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
/usr/lib64/python3.13/threading.py:35: in <module>
    _start_joinable_thread = _thread.start_joinable_thread
E   AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
__________________________________________________________________________________ ERROR collecting tests/subprocess_test.py ___________________________________________________________________________________
tests/subprocess_test.py:5: in <module>
    from eventlet.green import subprocess
eventlet/green/subprocess.py:8: in <module>
    from eventlet.green import select, threading, time
eventlet/green/threading.py:18: in <module>
    eventlet.patcher.inject(
eventlet/patcher.py:109: in inject  
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
/usr/lib64/python3.13/threading.py:35: in <module>
    _start_joinable_thread = _thread.start_joinable_thread
E   AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
__________________________________________________________________________________ ERROR collecting tests/test__greenness.py ___________________________________________________________________________________
tests/test__greenness.py:6: in <module>
    from eventlet.green import BaseHTTPServer
eventlet/green/BaseHTTPServer.py:3: in <module>
    from eventlet.green import SocketServer
eventlet/green/SocketServer.py:5: in <module>
    from eventlet.green import threading
eventlet/green/threading.py:18: in <module>
    eventlet.patcher.inject(
eventlet/patcher.py:109: in inject  
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
/usr/lib64/python3.13/threading.py:35: in <module>
    _start_joinable_thread = _thread.start_joinable_thread
E   AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
_________________________________________________________________________________ ERROR collecting tests/websocket_new_test.py _________________________________________________________________________________
tests/websocket_new_test.py:7: in <module>
    from eventlet import websocket  
eventlet/websocket.py:21: in <module>
    from eventlet import wsgi
eventlet/wsgi.py:14: in <module>
    from eventlet.green import BaseHTTPServer
eventlet/green/BaseHTTPServer.py:3: in <module>
    from eventlet.green import SocketServer
eventlet/green/SocketServer.py:5: in <module>
    from eventlet.green import threading
eventlet/green/threading.py:18: in <module>
    eventlet.patcher.inject(
eventlet/patcher.py:109: in inject  
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
/usr/lib64/python3.13/threading.py:35: in <module>
    _start_joinable_thread = _thread.start_joinable_thread
E   AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
___________________________________________________________________________________ ERROR collecting tests/websocket_test.py ___________________________________________________________________________________
tests/websocket_test.py:9: in <module>
    from eventlet.websocket import WebSocket, WebSocketWSGI
eventlet/websocket.py:21: in <module>
    from eventlet import wsgi
eventlet/wsgi.py:14: in <module>
    from eventlet.green import BaseHTTPServer
eventlet/green/BaseHTTPServer.py:3: in <module>
    from eventlet.green import SocketServer
eventlet/green/SocketServer.py:5: in <module>
    from eventlet.green import threading
eventlet/green/threading.py:18: in <module>
    eventlet.patcher.inject(
eventlet/patcher.py:109: in inject  
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
/usr/lib64/python3.13/threading.py:35: in <module>
    _start_joinable_thread = _thread.start_joinable_thread
E   AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
_____________________________________________________________________________________ ERROR collecting tests/wsgi_test.py ______________________________________________________________________________________
tests/wsgi_test.py:21: in <module>  
    from eventlet import wsgi
eventlet/wsgi.py:14: in <module>
    from eventlet.green import BaseHTTPServer
eventlet/green/BaseHTTPServer.py:3: in <module>
    from eventlet.green import SocketServer
eventlet/green/SocketServer.py:5: in <module>
    from eventlet.green import threading
eventlet/green/threading.py:18: in <module>
    eventlet.patcher.inject(
eventlet/patcher.py:109: in inject  
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
/usr/lib64/python3.13/threading.py:35: in <module>
    _start_joinable_thread = _thread.start_joinable_thread
E   AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'

----------- coverage: platform linux, python 3.13.0-beta-1 -----------
Name                                              Stmts   Miss Branch BrPart  Cover
-----------------------------------------------------------------------------------
[… coverage lines omitted …]
-----------------------------------------------------------------------------------
TOTAL                                              9778   8197   3538     43    13%

=========================================================================================== short test summary info ============================================================================================
ERROR tests/asyncio_test.py - AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
ERROR tests/subprocess_test.py - AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
ERROR tests/test__greenness.py - AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
ERROR tests/websocket_new_test.py - AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
ERROR tests/websocket_test.py - AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
ERROR tests/wsgi_test.py - AttributeError: module 'eventlet.green.thread' has no attribute 'start_joinable_thread'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================== 6 errors in 2.73s ===============================================================================================
py313: exit 2 (3.24 seconds) /home/ben/src/forks/eventlet> pytest --verbose --cov=eventlet tests/ pid=300264
  py313: FAIL code 2 (6.88=setup[0.13]+cmd[3.51,3.24] seconds)
  evaluation failed :( (6.94 seconds)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions