-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
pathlib.PurePath.match()
can incorrectly match empty path
#106330
Labels
3.12
bugs and security fixes
3.13
bugs and security fixes
topic-pathlib
type-bug
An unexpected behavior, bug, or error
Comments
pathlib.PurePath.match()
can incorrectly match empty patchpathlib.PurePath.match()
can incorrectly match empty path
Caused by #101398. In Python 3.13 this can also affect |
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jul 2, 2023
…h()` We match paths using the `_lines` attribute, which is derived from the path's string representation. The bug arises because an empty path's string representation is `'.'` (not `''`), which is matched by the `'*'` wildcard.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jul 2, 2023
barneygale
added a commit
that referenced
this issue
Jul 3, 2023
…H-106331) We match paths using the `_lines` attribute, which is derived from the path's string representation. The bug arises because an empty path's string representation is `'.'` (not `''`), which is matched by the `'*'` wildcard.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jul 3, 2023
…th.match()` (pythonGH-106331) We match paths using the `_lines` attribute, which is derived from the path's string representation. The bug arises because an empty path's string representation is `'.'` (not `''`), which is matched by the `'*'` wildcard. (cherry picked from commit b4efdf8) Co-authored-by: Barney Gale <barney.gale@gmail.com>
Fixed! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.12
bugs and security fixes
3.13
bugs and security fixes
topic-pathlib
type-bug
An unexpected behavior, bug, or error
This should be false, because a
*
segment always consumes exactly one path component, but empty paths have 0 components.Linked PRs
pathlib.PurePath.match()
#106331pathlib.PurePath.match()
(GH-106331) #106372The text was updated successfully, but these errors were encountered: