There was an error while loading. Please reload this page.
1 parent 4061939 commit 4b1e98bCopy full SHA for 4b1e98b
2 files changed
Lib/pathlib.py
@@ -192,7 +192,9 @@ def resolve(self, path, strict=False):
192
s = self._ext_to_normal(_getfinalpathname(s))
193
except FileNotFoundError:
194
previous_s = s
195
- s = os.path.abspath(os.path.join(s, os.pardir))
+ s = os.path.dirname(s)
196
+ if previous_s == s:
197
+ return path
198
else:
199
if previous_s is None:
200
return s
Misc/NEWS
@@ -40,6 +40,8 @@ Core and Builtins
40
Library
41
-------
42
43
+- Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows
44
+
45
- Issue #13051: Fixed recursion errors in large or resized
46
curses.textpad.Textbox. Based on patch by Tycho Andersen.
47
0 commit comments