Skip to content

Commit 0d210a1

Browse files
barneygaleGlyphack
authored andcommitted
pythonGH-78988: Document pathlib.Path.glob() exception propagation. (python#114036)
We propagate the `OSError` from the `is_dir()` call on the top-level directory, and suppress all others.
1 parent 6ceec38 commit 0d210a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,10 @@ call fails (for example because the path doesn't exist).
993993
Set *follow_symlinks* to ``True`` or ``False`` to improve performance
994994
of recursive globbing.
995995

996+
This method calls :meth:`Path.is_dir` on the top-level directory and
997+
propagates any :exc:`OSError` exception that is raised. Subsequent
998+
:exc:`OSError` exceptions from scanning directories are suppressed.
999+
9961000
By default, or when the *case_sensitive* keyword-only argument is set to
9971001
``None``, this method matches paths using platform-specific casing rules:
9981002
typically, case-sensitive on POSIX, and case-insensitive on Windows.

0 commit comments

Comments
 (0)