[New-bugs-announce] [issue30618] readlink for pathlib paths

smheidrich report at bugs.python.org
Fri Jun 9 19:55:59 EDT 2017


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 <report at bugs.python.org>
<http://bugs.python.org/issue30618>
_______________________________________


More information about the New-bugs-announce mailing list