[issue35857] Stacktrace shows lines from updated file on disk, not code actually running
Steven D'Aprano
report at bugs.python.org
Wed Jan 30 04:34:19 EST 2019
Steven D'Aprano <steve+python at pearwood.info> added the comment:
> It should instead show the lines from the file as it was when the code was executed.
How is Python supposed to do that without making a copy of every module and script it runs just in case it gets modified?
(That's not a rhetorical question -- if you can think of a cheap way to implement this, I'm listening :-)
99.99% of the time this would be a total waste of time, so this would be a very expensive exercise for very little gain. Python's startup time is already too slow without having to also make potentially hundreds of file copies every time you run a script.
For the record, I too once ran into this issue. It left me utterly confused for an hour or so until I worked out what was happening, and then I never made the mistake of editing a running script again.
----------
nosy: +steven.daprano
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35857>
_______________________________________
More information about the Python-bugs-list
mailing list