cpython: 9de7bf6c60d2 (original) (raw)
Mercurial > cpython
changeset 105884:9de7bf6c60d2
Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows [#29079]
Steve Dower steve.dower@microsoft.com | |
---|---|
date | Wed, 28 Dec 2016 16:03:28 -0800 |
parents | 38e44a23ea66(current diff)af8c8551ea45(diff) |
children | fc3eab44765f |
files | Misc/NEWS |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-)[+] [-] Lib/pathlib.py 4 Misc/NEWS 2 |
line wrap: on
line diff
--- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -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))[](#l1.7)
s = os.path.dirname(s)[](#l1.8)
if previous_s == s:[](#l1.9)
return path[](#l1.10) else:[](#l1.11) if previous_s is None:[](#l1.12) return s[](#l1.13)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -208,6 +208,8 @@ Core and Builtins Library ------- +- Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows +