diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-05-25 20:01:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-25 20:01:36 (GMT) |
commit | e418fc3a6e7bade68ab5dfe72f14ddba28e6acb5 (patch) | |
tree | 67662f1eba24dd69bfef714d0a48e1274927b480 /Doc/tutorial | |
parent | 0c5ebe13e9937c446e9947c44f2570737ecca135 (diff) | |
download | cpython-e418fc3a6e7bade68ab5dfe72f14ddba28e6acb5.zip cpython-e418fc3a6e7bade68ab5dfe72f14ddba28e6acb5.tar.gz cpython-e418fc3a6e7bade68ab5dfe72f14ddba28e6acb5.tar.bz2 |
GH-82805: Fix handling of single-dot file extensions in pathlib (#118952)
pathlib now treats "`.`" as a valid file extension (suffix). This brings
it in line with `os.path.splitext()`.
In the (private) pathlib ABCs, we add a new `ParserBase.splitext()` method
that splits a path into a `(root, ext)` pair, like `os.path.splitext()`.
This method is called by `PurePathBase.stem`, `suffix`, etc. In a future
version of pathlib, we might make these base classes public, and so users
will be able to define their own `splitext()` method to control file
extension splitting.
In `pathlib.PurePath` we add optimised `stem`, `suffix` and `suffixes`
properties that don't use `splitext()`, which avoids computing the path
base name twice.
Diffstat (limited to 'Doc/tutorial')
0 files changed, 0 insertions, 0 deletions