-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-92550 - Fix regression in pathlib.Path.rglob()
#92583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-92550 - Fix regression in pathlib.Path.rglob()
#92583
Conversation
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 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 `../` entries when we're sure we won't encounter symlinks. This reverts commit ea2f5bc.
Thanks @barneygale for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…2583) 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 ea2f5bc. (cherry picked from commit dcdf250) Co-authored-by: Barney Gale <barney.gale@gmail.com>
GH-92589 is a backport of this pull request to the 3.11 branch. |
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 ea2f5bc. (cherry picked from commit dcdf250) Co-authored-by: Barney Gale <barney.gale@gmail.com>
Wait, it is not a fix, it is a removing of the feature! |
This reverts commit dcdf250.
This reverts commit a51baec.
The |
The fix is trivial. #92604 |
The original fix is a bit of a hack because |
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 ea2f5bc.
Automerge-Triggered-By: GH:brettcannon