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 blueyed
Recipients blueyed
Date 2018-08-20.16:57:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534784236.56.0.56676864532.issue34444@psf.upfronthosting.co.za>
In-reply-to
Content
With "." in sys.path the "__file__" attribute will be a relative path, and therefore cannot be used after "chdir".

This likely affects relative paths in general, but have not tested it.

```
import os
import sys

sys.path.insert(0, '.')

# Importing it before chdir already causes failure.
import imported

os.chdir('/')
print(imported.__file__)  # ./imported.py
assert imported.__file__ == os.path.abspath(imported.__file__)
```

It works for "" in sys.path (https://bugs.python.org/issue18416).
History
Date User Action Args
2018-08-20 16:57:16blueyedsetrecipients: + blueyed
2018-08-20 16:57:16blueyedsetmessageid: <1534784236.56.0.56676864532.issue34444@psf.upfronthosting.co.za>
2018-08-20 16:57:16blueyedlinkissue34444 messages
2018-08-20 16:57:16blueyedcreate