cpython/Lib/test/test_pathlib
Barney Gale e418fc3a6e
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.
2024-05-25 21:01:36 +01:00
..
__init__.py
test_pathlib.py GH-74033: Drop deprecated `pathlib.Path` keyword arguments (#118793) 2024-05-14 20:14:07 +00:00
test_pathlib_abc.py GH-82805: Fix handling of single-dot file extensions in pathlib (#118952) 2024-05-25 21:01:36 +01:00