changeset: 105884:9de7bf6c60d2 parent: 105882:38e44a23ea66 parent: 105883:af8c8551ea45 user: Steve Dower date: Wed Dec 28 16:03:28 2016 -0800 files: Misc/NEWS description: Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows diff -r 38e44a23ea66 -r 9de7bf6c60d2 Lib/pathlib.py --- a/Lib/pathlib.py Wed Dec 28 15:43:45 2016 -0800 +++ b/Lib/pathlib.py Wed Dec 28 16:03:28 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 38e44a23ea66 -r 9de7bf6c60d2 Misc/NEWS --- a/Misc/NEWS Wed Dec 28 15:43:45 2016 -0800 +++ b/Misc/NEWS Wed Dec 28 16:03:28 2016 -0800 @@ -208,6 +208,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.