Barney Gale <[email protected]> added the comment:
For this bug specifically, the pathlib docs describe the desirable behaviour:
<quote>
Spurious slashes and single dots are collapsed, but double dots ('..') are not,
since this would change the meaning of a path in the face of symbolic links:
>>> PurePath('foo//bar')
PurePosixPath('foo/bar')
>>> PurePath('foo/./bar')
PurePosixPath('foo/bar')
>>> PurePath('foo/../bar')
PurePosixPath('foo/../bar')
(a naïve approach would make PurePosixPath('foo/../bar') equivalent to
PurePosixPath('bar'), which is wrong if foo is a symbolic link to another
directory)
</quote>
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44316>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com