GeezerVison is showing github.com — gh-101360: Fix anchor matching in pathlib.PureWindowsPath.match() by barneygale · Pull Request #101363 · python/cpython
Conversation
barneygale
commented
Jan 27, 2023
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
This can't be readily backported as it relies on a feature of pathlib in 3.12: support for non-alphabetic drive letters when parsing paths.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
support for non-alphabetic drive letters when parsing paths.
We need a test in "test_ntpath.py" to ensure that splitroot(' :/foo') == (' :', '/', 'foo') and splitroot('/:/foo') == ('', '/', ':/foo').
WinAPI GetFullPathNameW() will accept any character in the 16-bit BMP as a drive 'letter', except for null, slash, and backslash. For example:
>>> os.getcwd()
'C:\\Temp'
>>> nt._getfullpathname(' :/foo')
' :\\foo'
>>> nt._getfullpathname('/:/foo')
'C:\\:\\foo'
|
barneygale reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Change looks fine, just rerunning the failed tests.
|
barneygale and mokko reacted with thumbs up emoji
mokko reacted with laugh emoji
All reactions
-
👍
2 reactions
-
😄
1 reaction
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Apr 2, 2024
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.