[issue8087] Unupdated source file in traceback

Robert Reynolds report at bugs.python.org
Thu May 28 09:51:57 EDT 2020


Robert Reynolds <reynoldsrjr at gmail.com> added the comment:

I second [what was said by Aigars Mahinovs](https://bugs.python.org/issue8087#msg300990) about long-running processes giving confusing tracebacks that make debugging very difficult. I have a Natural Language Processing pipeline extracting features from a large corpus of texts, and that process can take days to complete. If the underlying modules have since been edited, then when an Exception occurs – including a KeyboardInterrupt – then the traceback shows the wrong lines. The functions listed at the end of the line are correct, which is the only reason I was able to easily detect the source of my confusion; the line number cited was no longer inside of the listed function!

I propose one more simple thing to track that would be helpful in my situation: how many lines were in the file at call time vs now. It would be (potentially) helpful to have a warning point out that the cited module is now 17 lines longer than it was when it was imported. That way I can make more intelligent guesses about what line was actually the culprit. Obviously there could have been additions and deletions, which muddies the water, but this would at least be a starting point.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue8087>
_______________________________________


More information about the Python-bugs-list mailing list