This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Michiel.de.Hoon, martin.panter, mdehoon, r.david.murray, serhiy.storchaka, vstinner
Date 2015-06-04.07:17:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433402248.65.0.341232341532.issue23237@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Michiel, if you are looking for the source of <https://docs.python.org/dev/c-api/veryhigh.html#c.PyOS_InputHook>, that corresponds to Doc/c-api/veryhigh.rst in the repository.

This bug would be fairly easy to solve for “tkinter” if we could drop the Tcl_DoOneEvent(0) half of the code, and always use the TCL_DONT_WAIT polling instead. Then the event hook could return if there were no immediate events, and it would be up to readline() or whatever to check for interrupts or input, or loop back to PyOS_InputHook() after a small delay.

Otherwise, I think we need to come up with a way to inject an event into a TCL event queue when there is a signal that needs handling. If this were possible, it would also fix the SIGINT responsiveness from Tk.mainloop() etc. Or it would be nice if there was a Tcl_DoOneEvent(WAIT_UNTIL_INTERRUPTED_BY_A_SIGNAL) option.

A possible test case for this bug would reopen stdin to something harmless, set a SIGALRM handler, and call input(). The signal should eventually cause input() to raise an exception.
History
Date User Action Args
2015-06-04 07:17:28martin.pantersetrecipients: + martin.panter, mdehoon, vstinner, r.david.murray, serhiy.storchaka, Michiel.de.Hoon
2015-06-04 07:17:28martin.pantersetmessageid: <1433402248.65.0.341232341532.issue23237@psf.upfronthosting.co.za>
2015-06-04 07:17:28martin.panterlinkissue23237 messages
2015-06-04 07:17:27martin.pantercreate