Hi list, 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:
#!/usr/bin/python
import threading
def stale():
import time
time.sleep(1000)
t = threading.Thread(target=stale)
t.start()
t._stop()
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>
t._stop()
File "/usr/lib/python3.4/threading.py", line 990, in _stop
assert not lock.locked()
AssertionError
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:
http://youtrack.jetbrains.com/issue/PY-12317
https://github.com/paramiko/paramiko/issues/286
Regards,
Felix Yan
signature.asc
Description: This is a digitally signed message part.
-- https://mail.python.org/mailman/listinfo/python-list
