[issue42730] TypeError/hang inside of Time.Sleep() when _thread.interrupt_main()

Eryk Sun report at bugs.python.org
Fri Dec 25 00:01:43 EST 2020


Eryk Sun <eryksun at gmail.com> added the comment:

When a process executes in the background from a non-interactive bash script, the initial handler for SIGINT is SIG_IGN (ignore). Prior to 3.7, _thread.interrupt_main() tries to trip SIGINT even when the C handler is set to SIG_IGN. But Python uses an integer constant for SIG_IGN (named IgnoreHandler in Modules/signalmodule.c), and trying to call it is a TypeError. This was fixed in 3.7+ to resolve bpo-23395. You've flagged this as an issue with 3.7, but the Stack Overflow question is for 3.6. If you're actually using 3.6 instead of 3.7, this issue should be closed as a duplicate.

To manually enable the normal KeyboardInterrupt exception, call signal.signal(signal.SIGINT, signal.default_int_handler).

----------
nosy: +eryksun
type:  -> behavior

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


More information about the Python-bugs-list mailing list