Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows

This commit is contained in:
Steve Dower 2016-12-28 16:03:28 -08:00
commit 0a24415b2f
2 changed files with 5 additions and 1 deletions

View File

@ -192,7 +192,9 @@ class _WindowsFlavour(_Flavour):
s = self._ext_to_normal(_getfinalpathname(s)) s = self._ext_to_normal(_getfinalpathname(s))
except FileNotFoundError: except FileNotFoundError:
previous_s = s 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: else:
if previous_s is None: if previous_s is None:
return s return s

View File

@ -208,6 +208,8 @@ Core and Builtins
Library Library
------- -------
- Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows
- Issue #13051: Fixed recursion errors in large or resized - Issue #13051: Fixed recursion errors in large or resized
curses.textpad.Textbox. Based on patch by Tycho Andersen. curses.textpad.Textbox. Based on patch by Tycho Andersen.