Message352355
Please consult the attached file "splitdrive.py". I redesigned splitdrive() to support "UNC" and "GLOBAL" junctions in device paths. I relaxed the design to allow repeated separators everywhere except for the UNC root. IIRC, Windows has supported this since XP. For example:
>>> print(nt._getfullpathname('//server///share'))
\\server\share
>>> print(nt._getfullpathname(r'\\server\\\share'))
\\server\share
There are also a couple of minor behavior changes in the new implementation.
The old implementation would split "//server/" as ('//server/', ''). Since there's no share, this should not count as a drive. The new implementation splits it as ('', '//server/'). Similarly it splits '//?/UNC/server/' as ('', '//?/UNC/server/').
The old implementation also allowed any character as a drive 'letter'. For example, it would split '/:/spam' as ('/:', '/spam'). The new implementation ensures that the drive letter in a DOS drive is alphabetic.
I also extended test_splitdrive to use a list of test cases in order to avoid having to define each case twice. It calls tester() a second time for each case, with slash and backslash swapped. |
|
Date |
User |
Action |
Args |
2019-09-13 16:05:15 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, serhiy.storchaka, steve.dower, nsiregar |
2019-09-13 16:05:15 | eryksun | set | messageid: <1568390715.47.0.96004958982.issue37609@roundup.psfhosted.org> |
2019-09-13 16:05:15 | eryksun | link | issue37609 messages |
2019-09-13 16:05:15 | eryksun | create | |
|