[issue43810] os.path.abspath returns invalid path (resolves symbolic link)

Eryk Sun report at bugs.python.org
Tue Apr 13 19:21:20 EDT 2021


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

If realpath() resolves too much, you'll have to resolve manually via os.path.islink() and os.readlink(). If you need strict resolution, use pathlib.Path.resolve(). In strict mode it raises FileNotFoundError if a path component doesn't exist. Also, even in non-strict mode, it raises RuntimeError for a symlink loop.

----------

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


More information about the Python-bugs-list mailing list