]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-114610: Fix `pathlib._abc.PurePathBase.with_suffix('.ext')` handling of stems...
authorBarney Gale <barney.gale@gmail.com>
Tue, 30 Jan 2024 14:25:16 +0000 (14:25 +0000)
committerGitHub <noreply@github.com>
Tue, 30 Jan 2024 14:25:16 +0000 (14:25 +0000)
commit809eed48058ea7391df57ead09dff53bcc5d81e9
tree310860ec40ccf4fa8d5996e52907979a7a8163c9
parente21754d7f8336d4647e28f355d8a3dbd5a2c7545
GH-114610: Fix `pathlib._abc.PurePathBase.with_suffix('.ext')` handling of stems (#114613)

Raise `ValueError` if `with_suffix('.ext')` is called on a path without a
stem. Paths may only have a non-empty suffix if they also have a non-empty
stem.

ABC-only bugfix; no effect on public classes.
Lib/pathlib/_abc.py
Lib/test/test_pathlib/test_pathlib.py
Lib/test/test_pathlib/test_pathlib_abc.py