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.
This commit is contained in:
Barney Gale 2024-01-16 22:28:54 +00:00 committed by GitHub
parent 2e672f7ca6
commit 7092b3f131
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View 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.