mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows
This commit is contained in:
parent
40619399bd
commit
4b1e98b0af
@ -192,7 +192,9 @@ class _WindowsFlavour(_Flavour):
|
||||
s = self._ext_to_normal(_getfinalpathname(s))
|
||||
except FileNotFoundError:
|
||||
previous_s = s
|
||||
s = os.path.abspath(os.path.join(s, os.pardir))
|
||||
s = os.path.dirname(s)
|
||||
if previous_s == s:
|
||||
return path
|
||||
else:
|
||||
if previous_s is None:
|
||||
return s
|
||||
|
Loading…
Reference in New Issue
Block a user