]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-114610: Fix `pathlib.PurePath.with_stem('')` handling of file extensions (#114612)
authorBarney Gale <barney.gale@gmail.com>
Sat, 24 Feb 2024 19:37:03 +0000 (19:37 +0000)
committerGitHub <noreply@github.com>
Sat, 24 Feb 2024 19:37:03 +0000 (19:37 +0000)
commite3dedeae7abbeda0cb3f1d872ebbb914635d64f2
treef4d9a7a39a371d142907e29340420751fbd9f79e
parent53c5c17e0a97ee06e511c89f1ca6ceb38fd06246
GH-114610: Fix `pathlib.PurePath.with_stem('')` handling of file extensions (#114612)

Raise `ValueError` if `with_stem('')` is called on a path with a file
extension. Paths may only have an empty stem if they also have an empty
suffix.
Lib/pathlib/_abc.py
Lib/test/test_pathlib/test_pathlib_abc.py
Misc/NEWS.d/next/Library/2024-01-26-16-42-31.gh-issue-114610.S18Vuz.rst [new file with mode: 0644]