-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
GH-106330: Fix matching of empty path in pathlib.PurePath.match()
#106331
GH-106330: Fix matching of empty path in pathlib.PurePath.match()
#106331
Conversation
…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.
Thanks v much Steve! |
Thanks @barneygale for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry @barneygale, I had trouble checking out the |
…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 <[email protected]>
GH-106372 is a backport of this pull request to the 3.12 branch. |
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.pathlib.PurePath.match()
can incorrectly match empty path #106330