]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)
authorBarney Gale <barney.gale@gmail.com>
Tue, 10 May 2022 00:12:16 +0000 (01:12 +0100)
committerGitHub <noreply@github.com>
Tue, 10 May 2022 00:12:16 +0000 (17:12 -0700)
commitdcdf250d2de1428f7d8b4e9ecf51d2fd8200e21a
tree73abe338405d711454c8dc931a87c2e45ba23da5
parentcb35402c1867b48704c2de1d1efd465ca738f374
gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)

We could try to remedy this by taking a slice, but we then run into an issue where the empty string will match altsep on POSIX. That rabbit hole could keep getting deeper.

A proper fix for the original issue involves making pathlib's path normalisation more configurable - in this case we want to retain trailing slashes, but in other we might want to preserve `./` prefixes, or elide `../` segments when we're sure we won't encounter symlinks.

This reverts commit ea2f5bcda1a392804487e6883be89fbad38a01a5.
Doc/library/pathlib.rst
Doc/whatsnew/3.11.rst
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2022-05-09-23-36-19.gh-issue-92550.qZ4AhU.rst [new file with mode: 0644]