New submission from Steve Dower <steve.do...@python.org>:

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\\'

----------
components: Windows
messages: 409903
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: UNC path normalisation issues on Windows
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46287>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to