You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pathlib.PurePath.match() doesn't use fnmatch() 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.
I think I know why this behaviour is here: pathlib originally wouldn't parse patterns like *:/ because it required drive letters to be alphabetic. match() worked around this by treating empty drives like *.
The alphabetic drive requirement was removed in 2ba0fd5 (3.12).
Activity
barneygale commentedon Jan 27, 2023
I think I know why this behaviour is here: pathlib originally wouldn't parse patterns like
*:/because it required drive letters to be alphabetic.match()worked around this by treating empty drives like*.The alphabetic drive requirement was removed in 2ba0fd5 (3.12).
pythongh-101360: Fix anchor matching in pathlib.PureWindowsPath.match()
pythongh-101360: Fix anchor matching in pathlib.PureWindowsPath.match()
Merge branch 'main' into pythongh-101360-fix-match-partial-anchor
gh-101360: Fix anchor matching in pathlib.PureWindowsPath.match() (GH…
barneygale commentedon Feb 17, 2023
Fixed in #101363 / d401b20