classification
Title: pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, ricpol, uranusjr
Priority: normal Keywords: patch

Created on 2019-11-03 09:55 by uranusjr, last changed 2019-12-27 18:53 by uranusjr.

Pull Requests
URL Status Linked Edit
PR 17716 open uranusjr, 2019-12-27 18:53
Messages (1)
msg355892 - (view) Author: Tzu-ping Chung (uranusjr) * Date: 2019-11-03 09:55
Originally from https://discuss.python.org/t/pathlib-absolute-vs-resolve/2573/4

>>> import pathlib
>>> pathlib.Path().resolve()
WindowsPath('C:/temp')
>>> list(pathlib.Path().iterdir())
[]
>>> pathlib.Path('foo').resolve()
WindowsPath('foo')
>>> pathlib.Path('bar').touch()
>>> pathlib.Path('bar').resolve()
WindowsPath('C:/temp/bar')
History
Date User Action Args
2019-12-27 18:53:54uranusjrsetkeywords: + patch
stage: patch review
pull_requests: + pull_request17161
2019-12-17 11:40:42ricpolsetnosy: + ricpol
2019-11-04 18:39:14brett.cannonsetnosy: + brett.cannon
components: + Library (Lib)
2019-11-04 06:39:08uranusjrsettitle: pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not existent -> pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist
2019-11-03 09:55:31uranusjrcreate