]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] GH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (GH-12515...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 13 Oct 2024 18:12:57 +0000 (20:12 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2024 18:12:57 +0000 (18:12 +0000)
commit094d95f62c12d2773c9bf116d449e31ede2681b1
treed3fd6aa399dda68e694b4406cb8090d3da527708
parentcff627a27dc5126ecb4113fc3fe7e444f410ba99
[3.13] GH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (GH-125156) (#125409)

`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.

(cherry picked from commit cb8e5995d89d9b90e83cf43310ec50e177484e70)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
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]