Skip to content

Commit 1575ea0

Browse files
bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529)
(cherry picked from commit 4696f12) Co-authored-by: Steve Dower <[email protected]>
1 parent 400bd9a commit 1575ea0

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

4040
_IGNORED_WINERRORS = (
4141
21, # ERROR_NOT_READY - drive exists but is not accessible
42+
123, # ERROR_INVALID_NAME - fix for bpo-35306
4243
1921, # ERROR_CANT_RESOLVE_FILENAME - fix for broken symlink pointing to itself
4344
)
4445

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)