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 deleted0524
Recipients deleted0524, ncoghlan, njs, yselivanov
Date 2017-05-23.18:12:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495563121.71.0.143396148151.issue29988@psf.upfronthosting.co.za>
In-reply-to
Content
This is either a "won't fix" or an "impossible to fix" depending on your point of view.

PATIENT:
     It hurts whenever I press ctrl-C
DOCTOR:
     Then don't press ctrl-C

The problem is that ctrl-C can provoke an interrupt at any point in the program, and thus break presumed invariants.
try-finally has the same problem.

From the observable side effects it is indistinguishable whether an interrupt occurs after the last instruction in an __enter__ function or after the first (side-effect-less) instruction after the __enter__.
Likewise the last pre-__exit__ and first in-__exit__ instructions are effectively the same from the point of view from observable side-effects, but are different from the point of view of the handling of exceptions.
History
Date User Action Args
2017-05-23 18:12:01deleted0524setrecipients: + deleted0524, ncoghlan, njs, yselivanov
2017-05-23 18:12:01deleted0524setmessageid: <1495563121.71.0.143396148151.issue29988@psf.upfronthosting.co.za>
2017-05-23 18:12:01deleted0524linkissue29988 messages
2017-05-23 18:12:01deleted0524create