Skip to content

Commit f43b3d5

Browse files
[3.11] bpo-44817: Ignore additional errors in ntpath.realpath (pythonGH-27574) (pythonGH-100022)
(cherry picked from commit 124ecd6) Co-authored-by: Michael Förderer <[email protected]>
1 parent 42fde2d commit f43b3d5

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
@@ -639,12 +639,15 @@ def _getfinalpathname_nonstrict(path):
639639
# 21: ERROR_NOT_READY (implies drive with no media)
640640
# 32: ERROR_SHARING_VIOLATION (probably an NTFS paging file)
641641
# 50: ERROR_NOT_SUPPORTED
642+
# 53: ERROR_BAD_NETPATH
643+
# 65: ERROR_NETWORK_ACCESS_DENIED
642644
# 67: ERROR_BAD_NET_NAME (implies remote server unavailable)
643645
# 87: ERROR_INVALID_PARAMETER
644646
# 123: ERROR_INVALID_NAME
647+
# 161: ERROR_BAD_PATHNAME
645648
# 1920: ERROR_CANT_ACCESS_FILE
646649
# 1921: ERROR_CANT_RESOLVE_FILENAME (implies unfollowable symlink)
647-
allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 1920, 1921
650+
allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 53, 65, 67, 87, 123, 161, 1920, 1921
648651

649652
# Non-strict algorithm is to find as much of the target directory
650653
# 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)