diff options
author | Barney Gale <barney.gale@gmail.com> | 2022-08-12 21:23:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 21:23:41 (GMT) |
commit | 187949ebf2ae36fcf0817a06f4a7637d0a8b7fc5 (patch) | |
tree | 97e2247dba696d69d682cefedf05d760c926bb07 /Misc | |
parent | a965db37f27ffb232312bc13d9a509f0d93fcd20 (diff) | |
download | cpython-187949ebf2ae36fcf0817a06f4a7637d0a8b7fc5.zip cpython-187949ebf2ae36fcf0817a06f4a7637d0a8b7fc5.tar.gz cpython-187949ebf2ae36fcf0817a06f4a7637d0a8b7fc5.tar.bz2 |
gh-94909: fix joining of absolute and relative Windows paths in pathlib (GH-95450)
Have pathlib use `os.path.join()` to join arguments to the `PurePath` initialiser, which fixes a minor bug when handling relative paths with drives.
Previously:
```python
>>> from pathlib import PureWindowsPath
>>> a = 'C:/a/b'
>>> b = 'C:x/y'
>>> PureWindowsPath(a, b)
PureWindowsPath('C:x/y')
```
Now:
```python
>>> PureWindowsPath(a, b)
PureWindowsPath('C:/a/b/x/y')
```
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-07-29-20-58-37.gh-issue-94909.YjMusj.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-07-29-20-58-37.gh-issue-94909.YjMusj.rst b/Misc/NEWS.d/next/Library/2022-07-29-20-58-37.gh-issue-94909.YjMusj.rst new file mode 100644 index 0000000..b6d8538 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-29-20-58-37.gh-issue-94909.YjMusj.rst @@ -0,0 +1,2 @@ +Fix incorrect joining of relative Windows paths with drives in +:class:`pathlib.PurePath` initializer. |