From: Barney Gale Date: Tue, 16 Jan 2024 22:28:54 +0000 (+0000) Subject: GH-78988: Document `pathlib.Path.glob()` exception propagation. (#114036) X-Git-Tag: v3.13.0a3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7092b3f1319269accf4c02f08256d51f111b9ca3;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 60791725c232..084d8bf4d3ca 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -993,6 +993,10 @@ call fails (for example because the path doesn't exist). Set *follow_symlinks* to ``True`` or ``False`` to improve performance of recursive globbing. + This method calls :meth:`Path.is_dir` on the top-level directory and + propagates any :exc:`OSError` exception that is raised. Subsequent + :exc:`OSError` exceptions from scanning directories are suppressed. + By default, or when the *case_sensitive* keyword-only argument is set to ``None``, this method matches paths using platform-specific casing rules: typically, case-sensitive on POSIX, and case-insensitive on Windows.