Author eryksun
Recipients eryksun, nsiregar, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Date 2019-09-13.16:05:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1568390715.47.0.96004958982.issue37609@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-09-13 16:05:15eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, serhiy.storchaka, steve.dower, nsiregar
2019-09-13 16:05:15eryksunsetmessageid: <1568390715.47.0.96004958982.issue37609@roundup.psfhosted.org>
2019-09-13 16:05:15eryksunlinkissue37609 messages
2019-09-13 16:05:15eryksuncreate