]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-99029: Fix handling of `PureWindowsPath('C:\<blah>').relative_to('C:')` (GH-99031)
authorBarney Gale <barney.gale@gmail.com>
Fri, 25 Nov 2022 19:15:57 +0000 (19:15 +0000)
committerGitHub <noreply@github.com>
Fri, 25 Nov 2022 19:15:57 +0000 (11:15 -0800)
commitae234fbc5ce045066448f2f0cda2f1c3c7ddebea
treed6ae5bf83f31bb68927a75f1f2e7172062797771
parent7d2dcc53d09fe903329926bf7bbfe460b1465dab
gh-99029: Fix handling of `PureWindowsPath('C:\<blah>').relative_to('C:')` (GH-99031)

`relative_to()` now treats naked drive paths as relative. This brings its
behaviour in line with other parts of pathlib, and with `ntpath.relpath()`,
and so allows us to factor out the pathlib-specific implementation.
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2022-11-02-23-47-07.gh-issue-99029.7uCiIB.rst [new file with mode: 0644]