[Python-Dev] threading bug? (original) (raw)

Tim Peters tim.one@home.com
Fri, 5 Oct 2001 15:16:29 -0400


[Thomas Heller]

Unhandled exception in thread: Traceback (most recent call last): _File "c:\python21\lib\threading.py", line 393, in bootstrap _self.stop() _File "c:\python21\lib\threading.py", line 399, in stop _self.block.notifyAll() File "c:\python21\lib\threading.py", line 235, in notifyAll _self.notify(len(self.waiters)) File "c:\python21\lib\threading.py", line 217, in notify me = currentThread() TypeError: object of type 'None' is not callable

This traceback does not appear when I register an atexit function to stop the thread.

We're missing basic info, like which OS and which Python release. More than one shutdown race has been fixed over the decades .

I've seen reports of this before, but under older Pythons, and/or in conjunction with running GUIs where the problem went away if the GUI was taken out of the equation. AFAIK, nobody ever stuck with it long enough to track down the real cause, though.

This relatively recent comment in pythonrun.c's Py_Finalize() is probably relevant:

/* The interpreter is still entirely intact at this point, and the

I expect that a foreign thread (== one not created by threading.py) isn't going to be waited for by threading.py's exit func .join(), and if so won't be protected by this mechanism (that's a shutdown race we can't really do anything about -- we've got no handle on what foreign threads do).