[New-bugs-announce] [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not existent

Tzu-ping Chung report at bugs.python.org
Sun Nov 3 04:55:31 EST 2019


New submission from Tzu-ping Chung <uranusjr at gmail.com>:

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')

----------
messages: 355892
nosy: uranusjr
priority: normal
severity: normal
status: open
title: pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not existent
versions: Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list