bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529)

(cherry picked from commit 4696f1285d)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2021-04-22 13:30:29 -07:00 committed by GitHub
parent 8e7cebb497
commit ab5d78ce41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -39,6 +39,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
)

View file

@ -0,0 +1,2 @@
Avoid raising errors from :meth:`pathlib.Path.exists()` when passed an
invalid filename.