[issue1596321] KeyError at exit after 'import threading' in other thread

Irit Katriel report at bugs.python.org
Mon Aug 16 18:17:30 EDT 2021


Irit Katriel <iritkatriel at gmail.com> added the comment:

The output is different now. 

I update the script for python 3:

---------------------------------------------
import _thread as thread
import time

def start():
	print("Secondary thread ID:", thread.get_ident())
	import threading

print("Main thread ID:", thread.get_ident())
thread.start_new_thread(start, ())
time.sleep(1)

---------------------------------------------

and the output is:

---------------------------------------------

Main thread ID: 4432801280
Secondary thread ID: 123145384259584
Exception ignored in: <module 'threading' from '/Users/iritkatriel/src/cpython-perf/Lib/threading.py'>
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-perf/Lib/threading.py", line 1512, in _shutdown
    assert tlock.locked()
    ^^^^^^^^^^^^^^^^^^^^^
AssertionError: 

---------------------------------------------

----------
nosy: +iritkatriel

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


More information about the Python-bugs-list mailing list