Skip to content

Commit 7092b3f

Browse files
authored
GH-78988: Document pathlib.Path.glob() exception propagation. (#114036)
We propagate the `OSError` from the `is_dir()` call on the top-level directory, and suppress all others.
1 parent 2e672f7 commit 7092b3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/pathlib.rst

+4
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)