]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid...
authorSteve Dower <steve.dower@python.org>
Thu, 22 Apr 2021 20:04:44 +0000 (21:04 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Apr 2021 20:04:44 +0000 (21:04 +0100)
Lib/pathlib.py
Misc/NEWS.d/next/Windows/2021-04-22-20-39-49.bpo-35306.F0Cg6X.rst [new file with mode: 0644]

index 1518d49f2212b2828a4a757ee4ef5532bdd39794..ebc2c02ecc0dc2a4b4c6753b94607f02f951481d 100644 (file)
@@ -33,6 +33,7 @@ _IGNORED_ERROS = (ENOENT, ENOTDIR, EBADF, ELOOP)
 
 _IGNORED_WINERRORS = (
     21,  # ERROR_NOT_READY - drive exists but is not accessible
+    123, # ERROR_INVALID_NAME - fix for bpo-35306
     1921,  # ERROR_CANT_RESOLVE_FILENAME - fix for broken symlink pointing to itself
 )
 
diff --git a/Misc/NEWS.d/next/Windows/2021-04-22-20-39-49.bpo-35306.F0Cg6X.rst b/Misc/NEWS.d/next/Windows/2021-04-22-20-39-49.bpo-35306.F0Cg6X.rst
new file mode 100644 (file)
index 0000000..af41b3c
--- /dev/null
@@ -0,0 +1,2 @@
+Avoid raising errors from :meth:`pathlib.Path.exists()` when passed an
+invalid filename.