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 njs
Recipients Mark, eryksun, louielu, martin.panter, njs, terry.reedy
Date 2017-06-28.23:24:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498692271.95.0.794629818926.issue29926@psf.upfronthosting.co.za>
In-reply-to
Content
In terms of general design cleanliness, I think it would be better to make `interrupt_main` work reliably than to have IDLE add workarounds for its unreliability.

AFAICT the ideal, minimal redundancy solution would be:

- interrupt_main just calls raise(SIGINT)
- bpo-21895 is fixed by adding a few lines to Python's C-level signal handler on Unix-likes to check if it's running in the main thread, and if not then use pthread_kill to redirect the signal to the main thread.

If trying to fix bpo-28195 is too controversial, then a minimal change would be:

- in interrupt_main, if we're on Windows, call raise(SIGINT); otherwise, call pthread_kill(main_thread, SIGINT)

And in either case we'd also have to document that interrupt_main is now equivalent to the user having hit control-C. But AFAICT that's what all its users really want anyway.
History
Date User Action Args
2017-06-28 23:24:31njssetrecipients: + njs, terry.reedy, martin.panter, Mark, eryksun, louielu
2017-06-28 23:24:31njssetmessageid: <1498692271.95.0.794629818926.issue29926@psf.upfronthosting.co.za>
2017-06-28 23:24:31njslinkissue29926 messages
2017-06-28 23:24:31njscreate