Message295592
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' |
|
Date |
User |
Action |
Args |
2017-06-09 23:55:59 | smheidrich | set | recipients:
+ smheidrich |
2017-06-09 23:55:59 | smheidrich | set | messageid: <1497052559.7.0.422106710991.issue30618@psf.upfronthosting.co.za> |
2017-06-09 23:55:59 | smheidrich | link | issue30618 messages |
2017-06-09 23:55:59 | smheidrich | create | |
|