New submission from smheidrich:

Is there any reason why there is no equivalent of os.readlink in pathlib.Path? 
Note that Path.resolve does *not* fit the bill, as it always produces an 
absolute path, whereas readlink just spits out the symlink target exactly the 
way it is stored, which may be relative to the symlink itself:

>>> import pathlib, os
>>> p = pathlib.Path("/lib64/libc.so.6")
>>> p.resolve()
PosixPath('/lib64/libc-2.24.so')
>>> os.readlink(str(p))
'libc-2.24.so'

----------
components: Library (Lib)
messages: 295592
nosy: smheidrich
priority: normal
severity: normal
status: open
title: readlink for pathlib paths
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to