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 pitrou
Recipients pitrou
Date 2017-09-19.13:00:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The threading main_thread() instance is associated to the thread that first imports the threading module.  In usual circumstances, this will indeed be the interpreter's main thread.  However, it is not always the case.  See attached reproducer.

$ ./python 
child thread: <_MainThread(MainThread, started 140399567398656)>
main thread: <_DummyThread(Dummy-1, started daemon 140399588386560)>
Exception ignored in: <module 'threading' from '/home/antoine/cpython/default/Lib/'>
Traceback (most recent call last):
  File "/home/antoine/cpython/default/Lib/", line 1268, in _shutdown
    assert tlock.locked()
Date User Action Args
2017-09-19 13:00:11pitrousetrecipients: + pitrou
2017-09-19 13:00:11pitrousetmessageid: <>
2017-09-19 13:00:11pitroulinkissue31517 messages
2017-09-19 13:00:11pitroucreate