https://github.com/python/cpython/commit/0ee681a665da36267d9e87ece472b9a9c5da9c13
commit: 0ee681a665da36267d9e87ece472b9a9c5da9c13
branch: 3.12
author: Barney Gale <barney.g...@gmail.com>
committer: barneygale <barney.g...@gmail.com>
date: 2024-01-16T22:39:09Z
summary:

[3.12] GH-78988: Document `pathlib.Path.glob()` exception propagation. 
(GH-114036) (#114154)

We propagate the `OSError` from the `is_dir()` call on the top-level
directory, and suppress all others.

(cherry picked from commit 7092b3f1319269accf4c02f08256d51f111b9ca3)

files:
M Doc/library/pathlib.rst

diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index d8fa4a27a28a0b..46a4d10b11d602 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -916,6 +916,10 @@ call fails (for example because the path doesn't exist).
        PosixPath('setup.py'),
        PosixPath('test_pathlib.py')]
 
+   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 -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to