]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-103631: Fix `PurePosixPath(PureWindowsPath(...))` separator handling (GH-104949)
authorBarney Gale <barney.gale@gmail.com>
Fri, 26 May 2023 18:05:43 +0000 (19:05 +0100)
committerGitHub <noreply@github.com>
Fri, 26 May 2023 18:05:43 +0000 (18:05 +0000)
commit328422ce6162eb18735a2c0de12f8a696be97d0c
tree30e21f0cee1c74251f04fd1d9929a7c437d13f67
parentad0be361c9922a918c7c3eaf83e1d8f2b019279c
GH-103631: Fix `PurePosixPath(PureWindowsPath(...))` separator handling (GH-104949)

For backwards compatibility, accept backslashes as path separators in
`PurePosixPath` if an instance of `PureWindowsPath` is supplied.
This restores behaviour from Python 3.11.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2023-05-25-23-34-54.gh-issue-103631.x5Urye.rst [new file with mode: 0644]