[issue25538] Traceback from __exit__ method is misleading

2020-11-27 Thread Alexander Kurakin
Change by Alexander Kurakin : -- nosy: +kuraga ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue25538] Traceback from __exit__ method is misleading

2020-07-17 Thread Tadhg McDonald-Jensen
Tadhg McDonald-Jensen added the comment: uploaded `with_traceback_fixed+async.py` because I forgot to include async with in my first code. -- Added file: https://bugs.python.org/file49323/with_traceback_fixed+async.py ___ Python tracker

[issue25538] Traceback from __exit__ method is misleading

2020-07-17 Thread Tadhg McDonald-Jensen
Tadhg McDonald-Jensen added the comment: This is doable, the feature that decides which line is shown in the traceback is the `lnotab` structure in the relevant code object, the structure is described here (https://github.com/python/cpython/blob/3.8/Objects/lnotab_notes.txt) and it supports

[issue25538] Traceback from __exit__ method is misleading

2017-03-29 Thread Frazer McLean
Changes by Frazer McLean : -- nosy: +RazerM ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue25538] Traceback from __exit__ method is misleading

2017-03-27 Thread R. David Murray
R. David Murray added the comment: See also issue 29922. -- nosy: +Tadhg McDonald-Jensen, yselivanov ___ Python tracker ___ ___ Python

[issue25538] Traceback from __exit__ method is misleading

2015-11-06 Thread R. David Murray
R. David Murray added the comment: Yes, I think the line that should be in the traceback in my example is the 'with' line. I have no clue how hard that would be to achieve. -- ___ Python tracker _

[issue25538] Traceback from __exit__ method is misleading

2015-11-06 Thread Martin Panter
Martin Panter added the comment: Explanation of my example because it is tricky: The print is actually executed. Then the context manager exits, and the built-in buffered file object tries to flush its buffer and fails. The earlier write() call succeeds, because it only writes to the Python bu

[issue25538] Traceback from __exit__ method is misleading

2015-11-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: In Martin's example, I would expect the first line of the traceback to be the file write that raised the exception, not the print that is never executed. If print were writing to a different device than the first line, the traceback would be positively mislea

[issue25538] Traceback from __exit__ method is misleading

2015-11-03 Thread R. David Murray
R. David Murray added the comment: What caught me out was more like this (but more complicated so it wasn't obvious the line mentioned wasn't part of the exception chain; in fact it looked like it was since it was a line that could very well have raised the exception in question): rdmurra

[issue25538] Traceback from __exit__ method is misleading

2015-11-02 Thread Martin Panter
Martin Panter added the comment: I guess you are mainly complaining about when __exit__() implementation is built into the interpreter. E.g., given demo.py: with open("/dev/full", "wb") as file: file.write(b"data") print("All is well") print("Not executed") the output looks like All i

[issue25538] Traceback from __exit__ method is misleading

2015-11-02 Thread R. David Murray
New submission from R. David Murray: 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 i