Issue30618
Created on 2017-06-09 23:55 by smheidrich, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 8285 | merged | girts, 2018-07-14 20:44 | |
| Messages (5) | |||
|---|---|---|---|
| msg295592 - (view) | Author: (smheidrich) | Date: 2017-06-09 23:55 | |
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'
|
|||
| msg320335 - (view) | Author: girts (girts) | Date: 2018-06-23 21:33 | |
Just ran into the same thing. I would be interested in adding support for a "readlink" call if a pull request on this would be welcome. |
|||
| msg324364 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2018-08-30 04:31 | |
The resolve() method already solves symlinks, but I think this is a reasonable feature request. I've just reviewed PR 8285. |
|||
| msg355266 - (view) | Author: miss-islington (miss-islington) | Date: 2019-10-23 21:18 | |
New changeset a01ba333affcc0677146dc8af57179bdb808d608 by Miss Skeleton (bot) (Girts) in branch 'master': bpo-30618: add readlink to pathlib.Path (GH-8285) https://github.com/python/cpython/commit/a01ba333affcc0677146dc8af57179bdb808d608 |
|||
| msg355271 - (view) | Author: Gregory P. Smith (gregory.p.smith) * | Date: 2019-10-23 22:37 | |
Thanks Girts! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:47 | admin | set | github: 74803 |
| 2019-10-23 22:37:43 | gregory.p.smith | set | status: open -> closed resolution: fixed messages: + msg355271 stage: patch review -> commit review |
| 2019-10-23 21:18:46 | miss-islington | set | nosy:
+ miss-islington messages: + msg355266 |
| 2019-10-23 20:55:16 | gregory.p.smith | set | assignee: gregory.p.smith nosy: + gregory.p.smith |
| 2019-07-20 04:41:23 | girtsf | set | versions: + Python 3.9, - Python 3.8 |
| 2018-08-30 04:31:25 | berker.peksag | set | nosy:
+ pitrou, berker.peksag messages:
+ msg324364 |
| 2018-07-14 20:44:51 | girts | set | keywords:
+ patch stage: patch review pull_requests: + pull_request7819 |
| 2018-06-23 21:33:59 | girts | set | nosy:
+ girts messages: + msg320335 |
| 2018-05-31 16:16:06 | tuxtimo | set | nosy:
+ tuxtimo |
| 2018-05-21 08:55:26 | spatz | set | nosy:
+ spatz |
| 2017-07-21 11:01:29 | planet36 | set | nosy:
+ smheidrich |
| 2017-07-21 11:01:00 | planet36 | set | nosy: + planet36, - smheidrich |
| 2017-06-09 23:55:59 | smheidrich | create | |