[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

Eryk Sun report at bugs.python.org
Sun Jun 13 23:35:12 EDT 2021


Eryk Sun <eryksun at gmail.com> added the comment:

I think separate keep_curdir and keep_pardir options is over-complicating the signature. Also, I'd prefer to remove a dot component if it's not the first component since there's no reason to keep it.

If you plan to use normpath() in pathlib, then the case for special_prefixes in ntpath.normpath() should be removed. Actually, it never should have been added. IIRC it was added as a workaround for a buggy implementation that's no longer an issue. Only \\?\ is special, and that's only when opening/accessing a path. It's not special in GetFullPathNameW(), as is called by ntpath.abspath() in Windows. This needlessly introduces inconsistency for ntpath.abspath() calls in Windows vs Unix.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44316>
_______________________________________


More information about the Python-bugs-list mailing list