Skip to content
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

[3.12] GH-106330: Fix matching of empty path in pathlib.PurePath.match() (GH-106331) #106372

Merged
merged 2 commits into from
Jul 4, 2023

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Jul 3, 2023

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)

…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]>
@barneygale barneygale merged commit d5ed72b into python:3.12 Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants