]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-130614: pathlib ABCs: retain original separator in `with_name()` (#130990)
authorBarney Gale <barney.gale@gmail.com>
Sun, 9 Mar 2025 16:36:20 +0000 (16:36 +0000)
committerGitHub <noreply@github.com>
Sun, 9 Mar 2025 16:36:20 +0000 (16:36 +0000)
commitba64cc5db410a893e6ff5bfee9210207947b69c2
treea41669debdce664f9e15dc3f5c039c488924a6cb
parentc240c2d88a080fc3c68c220aa81062cf5f130ab9
GH-130614: pathlib ABCs: retain original separator in `with_name()` (#130990)

In `pathlib.types._JoinablePath.with_name()`, retain any alternative path
separator preceding the old name, rather stripping and replacing it with a
primary separator. As a result, this method changes _only_ the name.
Lib/pathlib/types.py