diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-01-16 22:28:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 22:28:54 (GMT) |
commit | 7092b3f1319269accf4c02f08256d51f111b9ca3 (patch) | |
tree | 014159a182faed023ea4735467bd13c456e9a45e /Doc | |
parent | 2e672f7ca67470cbda3346a4b1b532cf5fa61799 (diff) | |
download | cpython-7092b3f1319269accf4c02f08256d51f111b9ca3.zip cpython-7092b3f1319269accf4c02f08256d51f111b9ca3.tar.gz cpython-7092b3f1319269accf4c02f08256d51f111b9ca3.tar.bz2 |
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.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pathlib.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 6079172..084d8bf 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. |