8000 [3.10] bpo-44817: Ignore additional errors in ntpath.realpath (GH-275… · python/cpython@0e2c783 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e2c783

Browse files
[3.10] bpo-44817: Ignore additional errors in ntpath.realpath (GH-27574) (GH-100023)
(cherry picked from commit 124ecd6) Co-authored-by: Michael Förderer <michael.foerderer@gmx.de>
1 parent 85be258 commit 0e2c783

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/ntpath.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,15 @@ def _getfinalpathname_nonstrict(path):
625625
# 21: ERROR_NOT_READY (implies drive with no media)
626626
# 32: ERROR_SHARING_VIOLATION (probably an NTFS paging file)
627627
# 50: ERROR_NOT_SUPPORTED
628+
# 53: ERROR_BAD_NETPATH
629+
# 65: ERROR_NETWORK_ACCESS_DENIED
628630
# 67: ERROR_BAD_NET_NAME (implies remote server unavailable)
629631
# 87: ERROR_INVALID_PARAMETER
630632
# 123: ERROR_INVALID_NAME
633+
# 161: ERROR_BAD_PATHNAME
631634
# 1920: ERROR_CANT_ACCESS_FILE
632635
# 1921: ERROR_CANT_RESOLVE_FILENAME (implies unfollowable symlink)
633-
allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 1920, 1921
636+
allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 53, 65, 67, 87, 123, 161, 1920, 1921
634637

635638
# Non-strict algorithm is to find as much of the target directory
636639
# as we can and join the rest.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Ignore WinError 53 (ERROR_BAD_NETPATH), 65 (ERROR_NETWORK_ACCESS_DENIED)
2+
and 161 (ERROR_BAD_PATHNAME) when using ntpath.realpath().

0 commit comments

Comments
 (0)
0