[issue36259] exception text is being sourced from the wrong file

2019-04-07 Thread Jesse Farnham
Jesse Farnham added the comment: Upon further digging, the filename to search for ultimately comes from the PyCodeObject where the error occurred. So a possible solution could be to populate the PyCodeObject with the absolute path to the file when it’s first created in compilation. Then no

[issue36259] exception text is being sourced from the wrong file

2019-04-07 Thread Jesse Farnham
Jesse Farnham 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

[issue36259] exception text is being sourced from the wrong file

2019-04-07 Thread Jesse Farnham
Change by Jesse Farnham : -- nosy: +jesse.farnham ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36259] exception text is being sourced from the wrong file

2019-03-11 Thread Ronald Oussoren
Change by Ronald Oussoren : -- versions: +Python 2.7, Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue36259] exception text is being sourced from the wrong file

2019-03-10 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I noticed a similar report in the past where using chdir causes pdb to use the file path relative to the directory where it chdir to . I am not sure if both are same but the issue I am talking about is issue33139 -- nosy: +xtreak

[issue36259] exception text is being sourced from the wrong file

2019-03-10 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36259] exception text is being sourced from the wrong file

2019-03-10 Thread rhubarbdog x
New submission from rhubarbdog x : Hi i have a directory containing a directory `bug` and the python program `bad.py`. The code for `bad.py` is ``` import os os.chdir('bug') print(7/0) ``` directory `bug` contains a file `bad.py` this file contents are ``` test 1 test 2 test 3 test 4 test 5