]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (#125156)
authorBarney Gale <barney.gale@gmail.com>
Sun, 13 Oct 2024 17:46:10 +0000 (18:46 +0100)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2024 17:46:10 +0000 (17:46 +0000)
commitcb8e5995d89d9b90e83cf43310ec50e177484e70
tree0a986d234ad90462a8a239431606a69511bc312b
parentc6d7b644c2425b397cfb641f336bea70eb8a329a
GH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (#125156)

`PurePath.__init__()` incorrectly uses the `_raw_paths` of a given
`PurePath` object with a different flavour, even though the procedure to
join path segments can differ between flavours.

This change makes the `_raw_paths`-enabled deferred joining apply _only_
when the path flavours match.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/pathlib/_local.py
Lib/test/test_pathlib/test_pathlib.py
Misc/NEWS.d/next/Library/2024-10-08-21-17-16.gh-issue-125069.0RP0Mx.rst [new file with mode: 0644]