Crash report
What happened?
The following code runs a subinterpreter in a new non-daemon thread, where CTRL+C+C interruption causes an assertion failure on debug builds:
fromconcurrentimportinterpretersdeff():
importtimetime.sleep(100)
if__name__=='__main__':
interp=interpreters.create()
print('press CTRL^C twice:')
t=interp.call_in_thread(f)
t.join()Assertionfailed: !_PyInterpreterState_IsRunningMain(interp), fileC:\rc\Python\pylifecycle.c, line2516
The same assert can be triggered without keystrokes:
importthreadingfromconcurrentimportinterpretersinterp=interpreters.create()
t=threading.Thread(target=interp.exec, daemon=True,
args=('import time; time.sleep(3)',))
t.start()cc @ericsnowcurrently
CPython versions tested on:
3.14.0rc1, CPython main branch: 2a87af0
Operating systems tested on:
Windows
Crash report
What happened?
The following code runs a subinterpreter in a new non-daemon thread, where CTRL+C+C interruption causes an assertion failure on debug builds:
The same assert can be triggered without keystrokes:
cc @ericsnowcurrently
CPython versions tested on:
3.14.0rc1, CPython main branch: 2a87af0
Operating systems tested on:
Windows