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
test_dummy_threading vs -O #40592
Comments
In Python 2.4, running test_dummy_threading with -O C:\Python23>python lib/test/regrtest.py C:\Python23>python -O lib/test/regrtest.py C:\Python23>cd \python24 C:\Python24>python lib/test/regrtest.py C:\Python24>python -O lib/test/regrtest.py
test_dummy_threading # not OK
test_dummy_threading
1 test OK.
Error in sys.exitfunc:
Traceback (most recent call last):
File "C:\Python24\lib\atexit.py", line 20, in
_run_exitfuncs
func(*targs, **kargs)
File "C:\Python24\lib\threading.py", line 607, in
__exitfunc
self._Thread__delete()
File "C:\Python24\lib\threading.py", line 497, in __delete
del _active[_get_ident()]
KeyError: -1 C:\Python24> |
Logged In: YES This is just turning into the month of my regression tests breaking, or at I will take a look and see if I can figure this one out this week. |
Logged In: YES OK, on the way to figuring this out, I think. Line 503 of Lib/threading.py has the statement Problem is that this doesn't happen under -O so threading._active doesn't As for it being a new error in 2.4, my CVS checkout for 2.3 has this error Now, it isn't from the tests, that much I am sure. If you change the |
Logged In: YES Then I think you'll find the answer if you do cvs diff -r r234 -r release23-maint threading.py I was using the released 2.3.4 Python. But on the current currentThread() # for side-effect These *were* unconditionally executed in 2.3.4, but don't I expect that explains why this didn't fail in 2.3.4. I don't |
Logged In: YES Can't add those lines back in without breaking the fixes to allow Plan on spending tonight on this one. Hopefully I will come up with |
Logged In: YES OK, problem goes away if you add a currentThread() call in __exitfunc() Does that solution work for you, Tim? Otherwise I am afraid I am going to have to come up with a custom dict |
Logged In: YES I don't think that will hurt anything. "The real problem" is of An alternative would be to suppress KeyError in __delete(). Another alternative would be to suppress KeyError in __delete |
Logged In: YES I like your last suggestion: doesn't get into side-effect dependence and I'll go ahead and commit that fix. |
Logged In: YES OK, fixed in Lib/threading.py for rev. 1.44 in HEAD and rev. 1.38.6.3 for |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: