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 MegaIng
Recipients MegaIng
Date 2020-11-07.22:19:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604787592.98.0.058051292798.issue42286@roundup.psfhosted.org>
In-reply-to
Content
When using a local trace function, sometimes the line event is issued at the wrong time. As can be seen from the example file `f_trace_wrong_line.py`, each loop iteration we get either 24 or 23, apparently in a fixed rhythm.

While this might seem harmless, it appears that the line event for 23 (In this example) is issued at a time where the state of the stack is not valid to switch line. I noticed this because I wanted to implement a context manager that skips to a specific line, but this broken with mysterious error message `TypeError: 'NoneType' object is not callable` which I think is caused by the `with`-line not being fully executed and the stack still having the return value of `__enter__` on it.



Here the intro line of the interpreter:

Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
History
Date User Action Args
2020-11-07 22:19:53MegaIngsetrecipients: + MegaIng
2020-11-07 22:19:52MegaIngsetmessageid: <1604787592.98.0.058051292798.issue42286@roundup.psfhosted.org>
2020-11-07 22:19:52MegaInglinkissue42286 messages
2020-11-07 22:19:52MegaIngcreate