]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-78988: Document `pathlib.Path.glob()` exception propagation. (#114036)
authorBarney Gale <barney.gale@gmail.com>
Tue, 16 Jan 2024 22:28:54 +0000 (22:28 +0000)
committerGitHub <noreply@github.com>
Tue, 16 Jan 2024 22:28:54 +0000 (22:28 +0000)
We propagate the `OSError` from the `is_dir()` call on the top-level
directory, and suppress all others.

Doc/library/pathlib.rst

index 60791725c2323ddca648fb3f31f1091af42bcfaf..084d8bf4d3ca2beaba73d72114e394e04f6f8edd 100644 (file)
@@ -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.