[New-bugs-announce] [issue43757] pathlib: move 'resolve()' logic out of path flavour

Barney Gale report at bugs.python.org
Tue Apr 6 22:32:48 EDT 2021


New submission from Barney Gale <barney.gale at gmail.com>:

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.

----------
components: Library (Lib)
messages: 390397
nosy: barneygale
priority: normal
severity: normal
status: open
title: pathlib: move 'resolve()' logic out of path flavour
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43757>
_______________________________________


More information about the New-bugs-announce mailing list