◐ Shell
clean mode source ↗

gh-101360: Fix anchor matching in pathlib.PureWindowsPath.match() by barneygale · Pull Request #101363 · python/cpython

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'