◐ Shell
clean mode source ↗

gh-94909: fix joining of absolute and relative Windows paths in pathlib by barneygale · Pull Request #95450 · python/cpython

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:

>>> from pathlib import PureWindowsPath
>>> a = 'C:/a/b'
>>> b = 'C:x/y'
>>> PureWindowsPath(a, b)
PureWindowsPath('C:x/y')

Now:

>>> PureWindowsPath(a, b)
PureWindowsPath('C:/a/b/x/y')

Automerge-Triggered-By: GH:brettcannon