Eryk Sun <[email protected]> added the comment:
> Hmm..., I get it, but Im not gonna lie it's pretty confusing given
> that in other places `//` works as a substitute for `/`. Maybe it
> should be mentioned in the documentation?
In Linux, the system resolves "//" as just "/". In other POSIX systems, such as
Cygwin or MSYS2 (running in Windows), "//" is a UNC path of the form
"//server/share/filepath". I would expect resolve() to handle this. For example:
Linux:
>>> p = pathlib.Path('//tmp')
>>> p
PosixPath('//tmp')
>>> p.resolve()
PosixPath('/tmp')
However, resolve() is broken for a UNC path in 3.9 under MSYS2:
>>> p = pathlib.Path('//localhost/C$/temp')
>>> p.exists()
True
>>> p.resolve()
PosixPath('/localhost/C$/temp')
>>> p.resolve().exists()
False
realpath() is also broken for this case in 3.9 under MSYS2:
>>> os.path.realpath(p)
'/localhost/C$/temp'
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue47161>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com