This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients CyberJacob, Decorater, Matt Groth, ellisj, eric.araujo, lazka, mwh, ncoghlan, pitrou, tiagoaoa, tim.peters, undercoveridiot, vlasovskikh, vstinner
Date 2019-05-23.12:46:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
There is a special case. If a thread calls os.fork() and raises an exception, the thread name is still logged even if there is only 1 thread after fork. Try attached

Output on Python 3.7:
main thread: spawn fork thread
thread: before fork [<_MainThread(MainThread, started 140623217481536)>, <ForkThread(Thread-1, started 140622996952832)>]
thread: after fork [<ForkThread(Thread-1, started 140622996952832)>]
thread: after fork: raise
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python3.7/", line 917, in _bootstrap_inner
  File "", line 17, in run
    raise Exception("what happens here?")
Exception: what happens here?

main thread: done

Moreover, threading.Thread silently ignores SystemExit in run() even if it's the only remaining thread (main thread is gone after fork).

I don't think that we *have to* change the current behavior. It's just that we have to take it in account if we modify how exceptions are handled.
Date User Action Args
2019-05-23 12:46:26vstinnersetrecipients: + vstinner, mwh, tim.peters, ncoghlan, ellisj, pitrou, tiagoaoa, eric.araujo, undercoveridiot, vlasovskikh, lazka, Decorater, CyberJacob, Matt Groth
2019-05-23 12:46:26vstinnersetmessageid: <>
2019-05-23 12:46:26vstinnerlinkissue1230540 messages
2019-05-23 12:46:25vstinnercreate