Jesse Farnham <jessefarnh...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36259>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to