Nick Coghlan <ncogh...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to