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 ncoghlan
Recipients Mark.Shannon, deleted0524, erik.bray, gregory.p.smith, jdemeyer, ncoghlan, njs, xgdomingo, yselivanov
Date 2017-09-07.18:10:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504807820.54.0.0785408568503.issue29988@psf.upfronthosting.co.za>
In-reply-to
Content
I think you're agreeing with me - we can make synchronous context managers meaningfully more signal safe (at least for CMs implemented in C, or precompiled with Cython), but for asynchronous context managers, the only meaningful defense available is to replace the default SIGINT handler with one that routes the signal to the event loop instead of trying to handle it in the interpreter's eval loop.

The latter approach does mean it will be more difficult to interrupt a runaway non-cooperative coroutine, but that's going to be a necessary trade-off in order to allow the event loop to reliably manage a graceful shutdown in the face of KeyboardInterrupt.
History
Date User Action Args
2017-09-07 18:10:20ncoghlansetrecipients: + ncoghlan, gregory.p.smith, njs, Mark.Shannon, erik.bray, jdemeyer, yselivanov, deleted0524, xgdomingo
2017-09-07 18:10:20ncoghlansetmessageid: <1504807820.54.0.0785408568503.issue29988@psf.upfronthosting.co.za>
2017-09-07 18:10:20ncoghlanlinkissue29988 messages
2017-09-07 18:10:20ncoghlancreate