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.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barneygale, brett.cannon, carltongibson, cjolowicz, miss-islington, paul.moore, ricpol, steve.dower, tim.golden, uranusjr, zach.ware
Priority: normal Keywords: patch

Created on 2019-11-03 09:55 by uranusjr, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17716 closed uranusjr, 2019-12-27 18:53
PR 26184 merged barneygale, 2021-05-17 00:09
PR 26270 merged barneygale, 2021-05-20 18:02
Messages (3)
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')
msg394108 - (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
msg399190 - (view) Author: Tzu-ping Chung (uranusjr) * Date: 2021-08-07 14:59
I think this can be closed now that the PRs are all merged?
History
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82852
2021-08-07 14:59:51uranusjrsetstatus: open -> closed
resolution: fixed
messages: + msg399190

stage: patch review -> resolved
2021-05-21 11:55:03miss-islingtonsetnosy: + miss-islington
messages: + msg394108
2021-05-20 18:02:01barneygalesetpull_requests: + pull_request24874
2021-05-19 06:53:06carltongibsonsetnosy: + carltongibson
2021-05-17 00:09:35barneygalesetnosy: + barneygale
pull_requests: + pull_request24802
2021-04-15 22:40:07cjolowiczsetnosy: + cjolowicz
2021-03-22 01:07:54eryksunlinkissue36860 superseder
2021-03-16 02:27:08eryksunlinkissue32434 superseder
2021-03-10 23:31:00eryksunsetnosy: + paul.moore, tim.golden, zach.ware, steve.dower

type: behavior
components: + Windows
versions: + Python 3.9, Python 3.10, - Python 3.6, Python 3.7
2020-07-31 14:24:54eryksunlinkissue41448 superseder
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