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 Mark.Shannon
Recipients Anthony Sottile, Mark.Shannon, nedbat, pablogsal
Date 2021-04-26.10:16:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619432189.9.0.641473510775.issue43933@roundup.psfhosted.org>
In-reply-to
Content
What exactly is the issue here?
That the line number is -1, or that is different from 3.9?

The `-1` should be `None`. I can fix that, but there is the issue of whether the cleanup code in a with statement should have a line number or not.

The traceback for 3.9 is incorrect, the program is not on line 10 when __exit__ is called.

Currently we mark the cleanup code for the with statement as artificial meaning that it has no line number.
We could give it the line number of the `with` keyword, but that might break coverage and profiling tools.

PEP 626 says that the "with" keyword is executable, and should be traced, but nothing about whether that includes the cleanup call to __exit__.
History
Date User Action Args
2021-04-26 10:16:29Mark.Shannonsetrecipients: + Mark.Shannon, nedbat, Anthony Sottile, pablogsal
2021-04-26 10:16:29Mark.Shannonsetmessageid: <1619432189.9.0.641473510775.issue43933@roundup.psfhosted.org>
2021-04-26 10:16:29Mark.Shannonlinkissue43933 messages
2021-04-26 10:16:29Mark.Shannoncreate