[issue22299] resolve() on Windows makes some pathological paths unusable

Antoine Pitrou report at bugs.python.org
Sat Sep 6 12:57:31 CEST 2014


Antoine Pitrou added the comment:

> Since both paths are valid and both paths refer to the same file, some developers may find this result counterintuitive.

On the other hand the proposed solution is regular. If you input an extended path, you get an extended path as output.

There are other factors that can come into play, such as hard links under Unix (and perhaps under Windows too). The recommended way to check if two paths point to the same file is still os.path.samefile().

Another approach would be for pathlib to *always* use extended paths internally on Windows absolute paths; I don't know which side effects that could have, though.

Note we could also add methods to switch from the extended to the regular form and vice-versa.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22299>
_______________________________________


More information about the Python-bugs-list mailing list