Author steve.dower
Recipients eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2022-01-06.19:36:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org>
In-reply-to
Content
Taken from https://github.com/python/cpython/pull/30362#issuecomment-1006840632

For Windows, should there be tests for invalid UNC paths such as "//", "//..", "//../..", "//../../..", "//server", "//server/..", and "//server/../.."? This will help to ensure that future changes never allow an invalid path to be normalized as a valid path.

Also, it's not a major problem that should prevent merging, but the way repeated slashes are handled prior to the second component of a UNC path is less than ideal:

>>> os.path.normpath('//spam///eggs')
'\\\\spam\\\\eggs'
>>> os.path.normpath('//spam///eggs/..')
'\\\\spam\\\\'
This case isn't a valid UNC share, since it's just "//spam", without a share component. However, the repeated slashes start the filepath part and should be reduced to a single backslash. That's what the GetFullPathNameW() call does in abspath():

>>> os.path.abspath('//spam///eggs')
'\\\\spam\\eggs'
>>> os.path.abspath('//spam///eggs/..')
'\\\\spam\\'
History
Date User Action Args
2022-01-06 19:36:40steve.dowersetrecipients: + steve.dower, paul.moore, tim.golden, zach.ware, eryksun
2022-01-06 19:36:40steve.dowersetmessageid: <1641497800.1.0.236156717354.issue46287@roundup.psfhosted.org>
2022-01-06 19:36:40steve.dowerlinkissue46287 messages
2022-01-06 19:36:40steve.dowercreate