https://github.com/python/cpython/commit/7092b3f1319269accf4c02f08256d51f111b9ca3
commit: 7092b3f1319269accf4c02f08256d51f111b9ca3
branch: main
author: Barney Gale <[email protected]>
committer: barneygale <[email protected]>
date: 2024-01-16T22:28:54Z
summary:
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.
files:
M Doc/library/pathlib.rst
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 60791725c2323d..084d8bf4d3ca2b 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.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]