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 jesse.farnham
Recipients jesse.farnham, rhubarbdog x, steven.daprano, xtreak
Date 2019-04-07.17:44:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554659086.68.0.0729992909602.issue36259@roundup.psfhosted.org>
In-reply-to
Content
I did some digging into this, and the problem seems to be that _Py_FindSourceFile() in traceback.c searches through every directory in sys.path (of which the first entry is the working directory) to find a file with the passed filename. So if there's a file in the working directory with name matching the filename passed in from the traceback object, _Py_FindSourceFile will find that one, resulting in the wrong listing being printed.

Does the traceback object contain any other information that would avoid the need to search sys.path to find the right file? If it can know the file name, maybe there's a way to find the file path as well?

Apologies if this is not useful -- this is my first attempt to contribute to Python.
History
Date User Action Args
2019-04-07 17:44:46jesse.farnhamsetrecipients: + jesse.farnham, steven.daprano, xtreak, rhubarbdog x
2019-04-07 17:44:46jesse.farnhamsetmessageid: <1554659086.68.0.0729992909602.issue36259@roundup.psfhosted.org>
2019-04-07 17:44:46jesse.farnhamlinkissue36259 messages
2019-04-07 17:44:46jesse.farnhamcreate