[issue4684] sys.exit() exits program when non-daemonic threads are still running

Joseph Malicki report at bugs.python.org
Thu Aug 27 00:28:54 CEST 2009


Joseph Malicki <jmalicki at gmail.com> added the comment:

It seems like this was introduced by the fix for Issue 1566280.

Note that the threading module docs clear state:

"A thread can be flagged as a “daemon thread”. The significance of this
flag is that the entire Python program exits when only daemon threads
are left. The initial value is inherited from the creating thread. The
flag can be set through the daemon property."

This behavior violates it.

The WaitForThreading() fix in Py_Main works only if sys.exit() is not
called, which disagrees with the documentation.

----------
nosy: +jmalicki

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4684>
_______________________________________


More information about the Python-bugs-list mailing list