[issue4684] sys.exit() exits program when non-daemonic threads are still running
Joseph Malicki 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 <http://bugs.python.org/issue4684> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4684] sys.exit() exits program when non-daemonic threads are still running
Joseph Malicki added the comment: Is it actually just documentation? Before Python 2.5, things worked according to the documentation, and nothing in the revisions that changed the behavior suggested this change in behavior was intentional. Moving the WaitForThreadShutdown() from Modules/main.c to Py_Finalize() would also fix this problem - I wonder why that wasn't the original change, as it more closely mirrors how Python 2.4 worked, and the documentation suggests? -- ___ Python tracker <http://bugs.python.org/issue4684> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com