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 Y Ono
Recipients Y Ono
Date 2020-05-20.00:50:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589935818.51.0.287299786193.issue40693@roundup.psfhosted.org>
In-reply-to
Content
```
import os
from pathlib import Path

os.chdir(Path(__file__).parent)
print(Path(__file__).absolute())
```
I put the code into a file in `/tmp/test.py`, and execute it from `/tmp/` directory like below. Then the output showed `/tmp/scripts/scripts/test.py`.

```
$ python scripts/test.py
/tmp/scripts/scripts/test.py
```


After executing `os.chdir`, pathlib's path handling is completely broken.
History
Date User Action Args
2020-05-20 00:50:18Y Onosetrecipients: + Y Ono
2020-05-20 00:50:18Y Onosetmessageid: <1589935818.51.0.287299786193.issue40693@roundup.psfhosted.org>
2020-05-20 00:50:18Y Onolinkissue40693 messages
2020-05-20 00:50:18Y Onocreate