This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pathlib: move 'resolve()' logic out of path flavour
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barneygale, eryksun, miss-islington, steve.dower, willingc
Priority: normal Keywords: patch

Created on 2021-04-07 02:32 by barneygale, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25264 merged barneygale, 2021-04-07 22:00
PR 26088 closed barneygale, 2021-05-13 01:15
PR 26090 merged barneygale, 2021-05-13 01:26
PR 26099 merged miss-islington, 2021-05-13 12:14
PR 26270 merged barneygale, 2021-05-20 18:02
Messages (5)
msg390397 - (view) Author: Barney Gale (barneygale) * Date: 2021-04-07 02:32
Under-the-hood functionality in pathlib is divided between:

- The 'flavour', which implements path syntax (separators, casefolding, etc)
- The 'accessor', which accesses the local (file)system.

The '_WindowsFlavour/_PosixFlavour.resolve()' function is misplaced, as it requires OS calls such as `os.getcwd()`, `os.readlink()`, and `nt._getfinalpathname()`. While the implementation *does* differ across Windows and POSIX, it's still properly part of the accessor interface, and not the flavour interface.

In preparation for addressing bpo-24132 I'd like to get these interfaces really tidy. Once bpo-39899 is fixed, this will be the last remaining flavour method that does accessor-y things.
msg391962 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-04-26 18:23
I'm happy with the PR as it stands now. Anyone else have an opinion?
msg392229 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-04-28 15:50
New changeset baecfbd849dbf42360d3a84af6cc13160838f24d by Barney Gale in branch 'master':
bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH-25264)
https://github.com/python/cpython/commit/baecfbd849dbf42360d3a84af6cc13160838f24d
msg393623 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2021-05-14 05:24
New changeset ea14a0749a4f19b29236fc0acc4b556d9243bc6f by Miss Islington (bot) in branch '3.10':
bpo-43757: Document os.path.realpath(strict=True) in 3.10 whatsnew. (GH-26090) (#26099)
https://github.com/python/cpython/commit/ea14a0749a4f19b29236fc0acc4b556d9243bc6f
msg394107 - (view) Author: miss-islington (miss-islington) Date: 2021-05-21 11:55
New changeset ee51c56c02d8eac28828a116fa35064919433d20 by Barney Gale in branch '3.10':
[3.10] bpo-38671: Add test that `pathlib.Path.resolve()` returns an absolute path. (GH-26184) (GH-26270)
https://github.com/python/cpython/commit/ee51c56c02d8eac28828a116fa35064919433d20
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87923
2021-05-21 11:55:03miss-islingtonsetmessages: + msg394107
2021-05-20 18:02:01barneygalesetpull_requests: + pull_request24875
2021-05-14 05:24:20willingcsetnosy: + willingc
messages: + msg393623
2021-05-13 12:14:53miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request24740
2021-05-13 01:26:33barneygalesetpull_requests: + pull_request24729
2021-05-13 01:15:37barneygalesetpull_requests: + pull_request24727
2021-04-28 15:50:36steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-28 15:50:25steve.dowersetmessages: + msg392229
2021-04-26 18:23:48steve.dowersetnosy: + eryksun, steve.dower
messages: + msg391962
2021-04-07 22:00:52barneygalesetkeywords: + patch
stage: patch review
pull_requests: + pull_request24000
2021-04-07 02:32:48barneygalecreate