-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
pathlib.Path.rglob("") raises IndexError in Python 3.11b1 #92550
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
Comments
Yes, looks like it:
cc. @brettcannon, @barneygale |
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
May 9, 2022
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.
miss-islington
pushed a commit
that referenced
this issue
May 10, 2022
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.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 10, 2022
…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>
miss-islington
added a commit
that referenced
this issue
May 10, 2022
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>
Why the whole feature was removed instead of applying a simple fix? @brettcannon |
serhiy-storchaka
added a commit
that referenced
this issue
May 10, 2022
This reverts commit dcdf250.
serhiy-storchaka
added a commit
that referenced
this issue
May 10, 2022
This reverts commit a51baec.
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
May 10, 2022
serhiy-storchaka
added a commit
that referenced
this issue
May 11, 2022
miss-islington
added a commit
that referenced
this issue
May 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Python 3.11b1 raises with the following given
path.rglob("")
wherepath
is apathlib.Path
. This worked in previous versions (and also in whichever previous alphas GitHub Actions used).rglob
is documented asso I think
""
is a valid input torglob()
.Pretty sure this was introduced in ea2f5bc/#10349.
Your environment
Cross-ref: pytest-dev/pytest#9930
The text was updated successfully, but these errors were encountered: