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 Mark.Shannon
Recipients Mark.Shannon, deleted0524, ncoghlan, njs, yselivanov
Date 2017-05-24.21:35:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If all you need is that

with foo:

guarantees that either both or neither of __enter__ and __exit__ are called, for C context managers, and only C context managers, then the fix is trivial.

To protect Python code would need a custom context manager wrapper

with ProtectsAgainstInterrupt(user_ctx_mngr()):

ProtectsAgainstInterrupt would need to be implemented in C and install a custom signal handler.
Date User Action Args
2017-05-24 21:35:48Mark.Shannonsetrecipients: + Mark.Shannon, ncoghlan, njs, yselivanov, deleted0524
2017-05-24 21:35:48Mark.Shannonsetmessageid: <>
2017-05-24 21:35:48Mark.Shannonlinkissue29988 messages
2017-05-24 21:35:48Mark.Shannoncreate