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, serhiy.storchaka, xgdomingo, yselivanov
Date 2018-07-09.13:47:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531144048.95.0.56676864532.issue29988@psf.upfronthosting.co.za>
In-reply-to
Content
While Greg Smith and I both cringed at the idea when I first raised it, I'm becoming more and more convinced that the only way we're going to be able to make resource cleanup reliable is for with statements to have the ability to disable signal handling while __enter__ and __exit__ methods are running.

When a with statement switches signal handling off in a particular execution context, there'd then need to be some absolute timing deadline for switching them back on, so resource acquisition or cleanup that got stuck in an infinite loop could still be interrupted eventually.

If you combined that with the signal handling approach in https://github.com/ncoghlan/cpython/pull/2/files, then I think we'd have as solid a solution as CPython is likely to be able to provide.
History
Date User Action Args
2018-07-09 13:47:29ncoghlansetrecipients: + ncoghlan, gregory.p.smith, njs, Mark.Shannon, erik.bray, serhiy.storchaka, jdemeyer, yselivanov, deleted0524, xgdomingo
2018-07-09 13:47:28ncoghlansetmessageid: <1531144048.95.0.56676864532.issue29988@psf.upfronthosting.co.za>
2018-07-09 13:47:28ncoghlanlinkissue29988 messages
2018-07-09 13:47:28ncoghlancreate