Thread._stop() behavior changed in Python 3.4
felixonmars at gmail.com
Mon Mar 17 18:18:01 CET 2014
I noticed a behavior change on Thread._stop() with Python 3.4.
I know the method is an undocumented "feature" itself, but some projects are
using it, and now they fail.
A minimized snippet to reproduce:
t = threading.Thread(target=stale)
This works correctly with Python 3.3, the program exits immediately after
t._stop() called, and no exception was raised.
But with Python 3.4, an AssertionError was raised:
Traceback (most recent call last):
File "test.py", line 8, in <module>
File "/usr/lib/python3.4/threading.py", line 990, in _stop
assert not lock.locked()
And the program still waits on the sleep().
I know trying to forcefully stop a thread is not really a good practice, but I
still wonder if there's an easy way to get broken programs to work again, just
in the way they currently are?
Downstream bug reports, for reference:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: This is a digitally signed message part.
More information about the Python-list