-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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.PureWindowsPath.match() mishandles path anchors #101360
Labels
3.10
only security fixes
3.11
only security fixes
3.12
bugs and security fixes
OS-windows
topic-pathlib
type-bug
An unexpected behavior, bug, or error
Comments
barneygale
added
type-bug
An unexpected behavior, bug, or error
3.11
only security fixes
3.10
only security fixes
3.12
bugs and security fixes
topic-pathlib
labels
Jan 26, 2023
I think I know why this behaviour is here: pathlib originally wouldn't parse patterns like The alphabetic drive requirement was removed in 2ba0fd5 (3.12). |
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jan 27, 2023
Use `fnmatch` to match path and pattern anchors, just as we do for other path parts. This allows patterns such as `'*:/Users/*'` to be matched.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jan 27, 2023
Use `fnmatch` to match path and pattern anchors, just as we do for other path parts. This allows patterns such as `'*:/Users/*'` to be matched.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jan 29, 2023
zooba
pushed a commit
that referenced
this issue
Feb 17, 2023
…-101363) Use `fnmatch` to match path and pattern anchors, just as we do for other path parts. This allows patterns such as `'*:/Users/*'` to be matched.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.10
only security fixes
3.11
only security fixes
3.12
bugs and security fixes
OS-windows
topic-pathlib
type-bug
An unexpected behavior, bug, or error
pathlib.PurePath.match()
doesn't usefnmatch()
to match path anchors, contrary to the documentation. Instead, it considers the drive and root of the pattern separately; if either (or both) is specified in the pattern, it must exactly match the corresponding drive/root in the path.This results in the following:
All of these results are wrong IMO.
Linked PRs
The text was updated successfully, but these errors were encountered: