classification
Title: `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barneygale, pitrou
Priority: normal Keywords: patch

Created on 2020-03-08 04:11 by barneygale, last changed 2020-04-17 17:46 by pitrou. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18839 merged barneygale, 2020-03-08 04:15
Messages (2)
msg363633 - (view) Author: Barney Gale (barneygale) * Date: 2020-03-08 04:11
`pathlib.Path.is_mount()` calls `Path(self.parent)`, which:

- Is needless, as `self.parent` is already a Path instance!
- Prevents effective subclassing, as `self.parent` may be a `Path` subclass with its own `stat()` implementation
msg366671 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2020-04-17 17:42
New changeset c746c4f353510a17683a49ed7f90ffaae664ff7b by Barney Gale in branch 'master':
bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (GH-18839)
https://github.com/python/cpython/commit/c746c4f353510a17683a49ed7f90ffaae664ff7b
History
Date User Action Args
2020-04-17 17:46:21pitrousetstatus: open -> closed
type: enhancement
resolution: fixed
stage: patch review -> resolved
2020-04-17 17:42:13pitrousetnosy: + pitrou
messages: + msg366671
2020-03-08 04:15:58barneygalesetkeywords: + patch
stage: patch review
pull_requests: + pull_request18196
2020-03-08 04:11:08barneygalecreate