[New-bugs-announce] [issue31516] current_thread() becomes "dummy" thread during shutdown

Antoine Pitrou report at bugs.python.org
Tue Sep 19 07:33:54 EDT 2017


New submission from Antoine Pitrou:

Attaching reproducer.  During interpreter shutdown, threading.main_thread() gets marked "stopped" (while it's obviously still running), while threading.current_thread() returns a DummyThread instance with the same ident as the main thread.

$ ./python mainthread.py 
-- before shutdown --
GC in thread <_MainThread(MainThread, started 140359122872064)>
main thread is <_MainThread(MainThread, started 140359122872064)>
-- during shutdown --
GC in thread <_DummyThread(Dummy-1, started daemon 140359122872064)>
main thread is <_MainThread(MainThread, stopped 140359122872064)>

----------
components: Library (Lib)
files: mainthread.py
messages: 302515
nosy: asvetlov, pitrou, tim.peters
priority: normal
severity: normal
stage: needs patch
status: open
title: current_thread() becomes "dummy" thread during shutdown
type: behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47152/mainthread.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31516>
_______________________________________


More information about the New-bugs-announce mailing list