Skip to content

Commit 4696f12

Browse files
authored
bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529)
1 parent a911bd1 commit 4696f12

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Lib/pathlib.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
_IGNORED_WINERRORS = (
3535
21, # ERROR_NOT_READY - drive exists but is not accessible
36+
123, # ERROR_INVALID_NAME - fix for bpo-35306
3637
1921, # ERROR_CANT_RESOLVE_FILENAME - fix for broken symlink pointing to itself
3738
)
3839

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

0 commit comments

Comments
 (0)