changeset: 105883:af8c8551ea45 branch: 3.6 parent: 105881:048d1942b325 user: Steve Dower date: Wed Dec 28 16:02:59 2016 -0800 files: Lib/pathlib.py Misc/NEWS description: Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows diff -r 048d1942b325 -r af8c8551ea45 Lib/pathlib.py --- a/Lib/pathlib.py Wed Dec 28 15:43:28 2016 -0800 +++ b/Lib/pathlib.py Wed Dec 28 16:02:59 2016 -0800 @@ -192,7 +192,9 @@ 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 diff -r 048d1942b325 -r af8c8551ea45 Misc/NEWS --- a/Misc/NEWS Wed Dec 28 15:43:28 2016 -0800 +++ b/Misc/NEWS Wed Dec 28 16:02:59 2016 -0800 @@ -40,6 +40,8 @@ Library ------- +- Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows + - Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox. Based on patch by Tycho Andersen.