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

Rene Visser report at bugs.python.org
Tue Apr 13 14:29:42 EDT 2021


Rene Visser <renevisser at gmail.com> added the comment:

Thanks Eryk for your fast response. Apparently I somehow skipped the remark
about symbolic links in combination with abspath. Thank you for pointing
this out and apologies for wasting some of your time!!
Best wishes, Rene Visser

On Mon, Apr 12, 2021 at 7:40 AM Eryk Sun <report at bugs.python.org> wrote:

>
> Eryk Sun <eryksun at gmail.com> added the comment:
>
> In POSIX, os.path.abspath(p) is normpath(join(os.getcwd(), p)). normpath()
> doesn't touch the filesystem, and it's documented that its "string
> manipulation may change the meaning of a path that contains symbolic
> links". You can use os.path.realpath() to resolve symbolic links in a path.
>
> ----------
> nosy: +eryksun
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue43810>
> _______________________________________
>

-- 

-------------------------------------------------------

René Visser
Stuttgart, Germany
email: renevisser at gmail.com

-------------------------------------------------------

----------

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


More information about the Python-bugs-list mailing list