Author pitrou
Recipients Mark, eryksun, louielu, martin.panter, njs, pitrou, terry.reedy
Date 2017-06-30.07:46:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Please step back a bit and read the implementation of interrupt_main(): it calls PyErr_SetInterrupt() (in signalmodule.c!), which merely sets an internal flag saying SIGINT was received.

So, there: PyErr_SetInterrupt() already behaves like SIGINT, *except* that it doesn't actually deliver a C signal, it merely sets a flag.  Which is the reason that it fails waking up C syscalls like select().


>>> def handler(signum, frame):
...     print("got signal %d!" % (signum,))
>>> signal.signal(signal.SIGINT, handler)
<built-in function default_int_handler>
>>> _thread.interrupt_main()
got signal 2!

In the end, making interrupt_main() *actually* deliver a SIGINT instead of merely setting the internal flag for it will certainly be true to the original intent.
Date User Action Args
2017-06-30 07:46:22pitrousetrecipients: + pitrou, terry.reedy, njs, martin.panter, Mark, eryksun, louielu
2017-06-30 07:46:22pitrousetmessageid: <>
2017-06-30 07:46:22pitroulinkissue29926 messages
2017-06-30 07:46:22pitroucreate