Title: pathlib: move 'resolve()' logic out of path flavour
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.10
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barneygale
Priority: normal Keywords: patch

Created on 2021-04-07 02:32 by barneygale, last changed 2021-04-07 22:00 by barneygale.

Pull Requests
URL Status Linked Edit
PR 25264 open barneygale, 2021-04-07 22:00
Messages (1)
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.
Date User Action Args
2021-04-07 22:00:52barneygalesetkeywords: + patch
stage: patch review
pull_requests: + pull_request24000
2021-04-07 02:32:48barneygalecreate