Author Paul Pinterits
Recipients Paul Pinterits
Date 2017-08-27.20:17:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The file paths displayed in exception tracebacks have their symlinks resolved. I would prefer if the "original" path could be displayed instead, because resolved symlinks result in unexpected paths in the traceback and can be quite confusing.

An example:

rawing@localhost ~> cat test_scripts/
import B

rawing@localhost ~> cat test_scripts/
def throw():
    raise ValueError

rawing@localhost ~> ln -s test_scripts test_symlink

rawing@localhost ~> python3 test_symlink/
Traceback (most recent call last):
  File "test_symlink/", line 2, in <module>
  File "/home/rawing/test_scripts/", line 2, in throw
    raise ValueError

As you can see, even though both scripts reside in the same directory, the file paths displayed in the traceback look very different. At first glance, it looks like B is in a completely different place than A.
Furthermore, this behavior tends to trip up IDEs - PyCharm for example does not understand that test_scripts/ and test_symlink/ are the same file, so I end up having the same file opened in two different tabs.

Would it be possible to change this behavior and have "/home/rawing/test_symlink/" show up in the traceback instead?
Date User Action Args
2017-08-27 20:17:56Paul Pinteritssetrecipients: + Paul Pinterits
2017-08-27 20:17:56Paul Pinteritssetmessageid: <>
2017-08-27 20:17:56Paul Pinteritslinkissue31289 messages
2017-08-27 20:17:56Paul Pinteritscreate