From a26672ed01187f6b418d6fae41bea51e9a8c6a8f Mon Sep 17 00:00:00 2001 From: Spacetown Date: Tue, 3 Aug 2021 07:38:24 +0200 Subject: [PATCH 1/4] bpo-44817: Ignore WinError 161 (ERROR_BAD_PATHNAME) --- Lib/ntpath.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 527c7ae1938fbb..65f2767e3afd5e 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -602,9 +602,10 @@ def _getfinalpathname_nonstrict(path): # 67: ERROR_BAD_NET_NAME (implies remote server unavailable) # 87: ERROR_INVALID_PARAMETER # 123: ERROR_INVALID_NAME + # 161: ERROR_BAD_PATHNAME # 1920: ERROR_CANT_ACCESS_FILE # 1921: ERROR_CANT_RESOLVE_FILENAME (implies unfollowable symlink) - allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 1920, 1921 + allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 161, 1920, 1921 # Non-strict algorithm is to find as much of the target directory # as we can and join the rest. From fa1827c301a65cbeb225e49980c0eb41f56e5d6d Mon Sep 17 00:00:00 2001 From: Spacetown Date: Wed, 4 Aug 2021 20:22:13 +0200 Subject: [PATCH 2/4] bp-44817: Ignore WinError 53 (ERROR_BAD_NETPATH) as suggested. --- Lib/ntpath.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 65f2767e3afd5e..f6dce70dcb08a8 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -599,13 +599,14 @@ def _getfinalpathname_nonstrict(path): # 21: ERROR_NOT_READY (implies drive with no media) # 32: ERROR_SHARING_VIOLATION (probably an NTFS paging file) # 50: ERROR_NOT_SUPPORTED + # 53: ERROR_BAD_NETPATH # 67: ERROR_BAD_NET_NAME (implies remote server unavailable) # 87: ERROR_INVALID_PARAMETER # 123: ERROR_INVALID_NAME # 161: ERROR_BAD_PATHNAME # 1920: ERROR_CANT_ACCESS_FILE # 1921: ERROR_CANT_RESOLVE_FILENAME (implies unfollowable symlink) - allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 161, 1920, 1921 + allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 53, 67, 87, 123, 161, 1920, 1921 # Non-strict algorithm is to find as much of the target directory # as we can and join the rest. From 33ea9e5f70dba3e1b044d5bb137719c84ff2ae7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20F=C3=B6rderer?= Date: Thu, 5 Aug 2021 09:28:11 +0200 Subject: [PATCH 3/4] bp-44817: Ignore WinError 65 (ERROR_NETWORK_ACCESS_DENIED) as suggested. --- Lib/ntpath.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/ntpath.py b/Lib/ntpath.py index f6dce70dcb08a8..9b00818b37a9ad 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -600,13 +600,14 @@ def _getfinalpathname_nonstrict(path): # 32: ERROR_SHARING_VIOLATION (probably an NTFS paging file) # 50: ERROR_NOT_SUPPORTED # 53: ERROR_BAD_NETPATH + # 65: ERROR_NETWORK_ACCESS_DENIED # 67: ERROR_BAD_NET_NAME (implies remote server unavailable) # 87: ERROR_INVALID_PARAMETER # 123: ERROR_INVALID_NAME # 161: ERROR_BAD_PATHNAME # 1920: ERROR_CANT_ACCESS_FILE # 1921: ERROR_CANT_RESOLVE_FILENAME (implies unfollowable symlink) - allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 53, 67, 87, 123, 161, 1920, 1921 + allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 53, 65, 67, 87, 123, 161, 1920, 1921 # Non-strict algorithm is to find as much of the target directory # as we can and join the rest. From 5e141050ed6a9e5f900208961f87fac657f20a2d Mon Sep 17 00:00:00 2001 From: Spacetown Date: Thu, 17 Mar 2022 20:58:48 +0100 Subject: [PATCH 4/4] Add News entry. --- .../next/Library/2021-08-03-05-31-00.bpo-44817.wOW_Qn.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2021-08-03-05-31-00.bpo-44817.wOW_Qn.rst diff --git a/Misc/NEWS.d/next/Library/2021-08-03-05-31-00.bpo-44817.wOW_Qn.rst b/Misc/NEWS.d/next/Library/2021-08-03-05-31-00.bpo-44817.wOW_Qn.rst new file mode 100644 index 00000000000000..79f8c506b54f37 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-08-03-05-31-00.bpo-44817.wOW_Qn.rst @@ -0,0 +1,2 @@ +Ignore WinError 53 (ERROR_BAD_NETPATH), 65 (ERROR_NETWORK_ACCESS_DENIED) +and 161 (ERROR_BAD_PATHNAME) when using ntpath.realpath().