New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix current thread join runtime error #641
Conversation
Codecov Report
@@ Coverage Diff @@
## master #641 +/- ##
==========================================
- Coverage 98.78% 98.65% -0.14%
==========================================
Files 10 10
Lines 743 744 +1
Branches 132 133 +1
==========================================
Hits 734 734
Misses 5 5
- Partials 4 5 +1 |
Hit this today when streaming downloads with requests. |
Thanks for this fix (worked for me, on this particular issue) |
ping... |
I don't get it, why this PR wasn't merged? Is this bug fixed? I just ran into it today but I'm not sure I was on the latest version of tqdm. I'll relaunch the process with the last version this time. |
This bug still occurs on master and latest release, had to downgrade to 4.21.0 to avoid it. What's the status on this? |
This PR fixes #613
Explain:
When
exit
, aTMonitor
thread wants to join itself, but if it cannot do that if it is the current thread, which will raise an error as in File "/Users/guchen/anaconda3/lib/python3.6/threading.py"I just add one line to check whether it is the current thread. See #613 for more discussion. In fact, it rarely happens. For instance, in a case that the main thread is killed by accident (eg, by errors) and only the TMonitor thread remains.
Code to reproduce the error