summaryrefslogtreecommitdiff
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2019-09-11 10:48:36 +0100
committerZachary Ware <zachary.ware@gmail.com>2019-09-11 10:48:36 +0100
commit92521fea5d0d4aeb9b6a3c3fdd4654af700ad5c8 (patch)
tree7ae2a23543d91404755d096ba5b2bb38888b4f2b /Lib/ntpath.py
parent455122a0094c8cfdf7e062eccc5e5b5885c75e8b (diff)
downloadcpython-git-92521fea5d0d4aeb9b6a3c3fdd4654af700ad5c8.tar.gz
bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899)
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 1d22d5f1dc..1b5e16f95f 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -535,9 +535,10 @@ else:
try:
path = _nt_readlink(path)
except OSError as ex:
- # Stop on file (2) or directory (3) not found, or
- # paths that are not reparse points (4390)
- if ex.winerror in (2, 3, 4390):
+ # Stop on incorrect function (1), file (2) or
+ # directory (3) not found, or paths that are
+ # not reparse points (4390)
+ if ex.winerror in (1, 2, 3, 4390):
break
raise
except ValueError:
@@ -553,9 +554,9 @@ else:
except OSError:
pass
- # Allow file (2) or directory (3) not found, invalid syntax (123),
- # and symlinks that cannot be followed (1921)
- allowed_winerror = 2, 3, 123, 1921
+ # Allow file (2) or directory (3) not found, incorrect parameter (87),
+ # invalid syntax (123), and symlinks that cannot be followed (1921)
+ allowed_winerror = 2, 3, 87, 123, 1921
# Non-strict algorithm is to find as much of the target directory
# as we can and join the rest.