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 r.david.murray
Recipients r.david.murray
Date 2015-11-02.23:08:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446505683.0.0.402181965789.issue25538@psf.upfronthosting.co.za>
In-reply-to
Content
This is at least the second time that I've wasted a bunch of debugging time being mislead by the traceback from __exit__.  Perhaps I will remember from now on, but...I wonder if it would be possible/practical to improve the situation.  The problem is that in the traceback printed when __exit__ throws an error, the source line printed before the source line from inside the __exit__ is the last line of the 'with' block.  I kept staring at that line trying to figure out how the exception could possibly be getting raised from that line...which of course it wasn't really, it was the "line" in between that one and the next one, a psuedo-line representing the exit from the block.

I don't know if it would be worth the effort that would be required to somehow clarify this in the traceback (I'm not even sure what that would *look* like...maybe the first line of the with block instead?), but I thought I'd raise the issue to see if anyone had any clever ideas.

(Hopefully I haven't done this before...I tried searching for similar issues and didn't find anything.)
History
Date User Action Args
2015-11-02 23:08:03r.david.murraysetrecipients: + r.david.murray
2015-11-02 23:08:03r.david.murraysetmessageid: <1446505683.0.0.402181965789.issue25538@psf.upfronthosting.co.za>
2015-11-02 23:08:02r.david.murraylinkissue25538 messages
2015-11-02 23:08:02r.david.murraycreate