Python 2.7 broken due to threading.main_thread() call in client.py
See original GitHub issueWhen I try to run the example client code the following is thrown
Traceback (most recent call last):
File "client1.py", line 4, in <module>
sio = socketio.Client()
File "[path to local lib]/python2.7/site-packages/socketio/client.py", line 88, in __init__
threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'
In client.py on line 88 a call is made to threading.main_thread()
which appears to be a Python 3-only call available on the threading
module.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
threading — Thread-based parallelism — Python 3.11.1 ...
Source code: Lib/threading.py This module constructs higher-level threading interfaces on top of the ... Handle uncaught exception raised by Thread.run() .
Read more >Python Threading: The Complete Guide
The run() function stores a return value as an instance variable, that is then accessed and reported by the main thread after the...
Read more >Threading issue in Python 2.7 - Stack Overflow
Main Thread. If you do not need the execution of tm to happen in another thread, simple call the function in the current...
Read more >Incompatibility with multiprocessing.pool in Python 2.7.x #147
The fix in the comment patches current_thread() to return the proper threading.Thread object after a call to Eventlet.monkey_patch() , which ...
Read more >Python Multithreading and Multiprocessing Tutorial - Toptal
Threading is just one of the many ways concurrent programs can be built. In this article, we will take a look at threading...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
another workaround is to install an older version of this library, 4.2.1 worked for me.
@zur250 I show a manual workaround in a video I made that might work for you. Here is a timestamped start into the video at the part where I make the change. It’s a small tweak and worked for me. https://youtu.be/ZEsuIQgsORc?t=209