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 alonho, benjamin.peterson, hniksic, ncoghlan, nikratio
Date 2013-11-10.13:22:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384089743.55.0.325130960491.issue18861@psf.upfronthosting.co.za>
In-reply-to
Content
Unrelated to my previous comment, I'm also wondering if this may actually represent a behavioural difference between contextlib.ExitStack and the interpreter's own exception handling machinery.

ExitStack uses a recursive->iterative transformation for its stack unwinding (see issue 14963), and it needs to do a bit of fiddling to get the context right (see issue 19092).

While the contextlib test suite goes to great lengths to try to ensure the semantics of normal stack unwinding are preserved, that definitely doesn't currently cover this case, and I'm thinking the way it works may actually be more like the behaviour Nikolaus expected in the original post (i.e. setting the context as the stack is unwound rather than when the replacement exception is raised).
History
Date User Action Args
2013-11-10 13:22:23ncoghlansetrecipients: + ncoghlan, hniksic, benjamin.peterson, nikratio, alonho
2013-11-10 13:22:23ncoghlansetmessageid: <1384089743.55.0.325130960491.issue18861@psf.upfronthosting.co.za>
2013-11-10 13:22:23ncoghlanlinkissue18861 messages
2013-11-10 13:22:23ncoghlancreate