mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
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')
```
This commit is contained in:
parent
a965db37f2
commit
187949ebf2
3 changed files with 14 additions and 33 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Fix incorrect joining of relative Windows paths with drives in
|
||||
:class:`pathlib.PurePath` initializer.
|
||||
Loading…
Add table
Add a link
Reference in a new issue