File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Misc/NEWS.d/next/Documentation Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ The :mod:`!glob` module defines the following functions:
8383 This function may return duplicate path names if *pathname *
8484 contains multiple "``** ``" patterns and *recursive * is true.
8585
86+ .. note ::
87+ Any :exc: `OSError ` exceptions raised from scanning the filesystem are
88+ suppressed. This includes :exc: `PermissionError ` when accessing
89+ directories without read permission.
90+
8691 .. versionchanged :: 3.5
8792 Support for recursive globs using "``** ``".
8893
@@ -106,6 +111,11 @@ The :mod:`!glob` module defines the following functions:
106111 This function may return duplicate path names if *pathname *
107112 contains multiple "``** ``" patterns and *recursive * is true.
108113
114+ .. note ::
115+ Any :exc: `OSError ` exceptions raised from scanning the filesystem are
116+ suppressed. This includes :exc: `PermissionError ` when accessing
117+ directories without read permission.
118+
109119 .. versionchanged :: 3.5
110120 Support for recursive globs using "``** ``".
111121
Original file line number Diff line number Diff line change @@ -1365,6 +1365,11 @@ Reading directories
13651365 ``False ``, this method follows symlinks except when expanding "``** ``"
13661366 wildcards. Set *recurse_symlinks * to ``True `` to always follow symlinks.
13671367
1368+ .. note ::
1369+ Any :exc: `OSError ` exceptions raised from scanning the filesystem are
1370+ suppressed. This includes :exc: `PermissionError ` when accessing
1371+ directories without read permission.
1372+
13681373 .. audit-event :: pathlib.Path.glob self,pattern pathlib.Path.glob
13691374
13701375 .. versionchanged :: 3.12
@@ -1391,6 +1396,11 @@ Reading directories
13911396 The paths are returned in no particular order.
13921397 If you need a specific order, sort the results.
13931398
1399+ .. note ::
1400+ Any :exc: `OSError ` exceptions raised from scanning the filesystem are
1401+ suppressed. This includes :exc: `PermissionError ` when accessing
1402+ directories without read permission.
1403+
13941404 .. seealso ::
13951405 :ref: `pathlib-pattern-language ` and :meth: `Path.glob ` documentation.
13961406
Original file line number Diff line number Diff line change 1+ Document that :func: `glob.glob `, :func: `glob.iglob `,
2+ :meth: `pathlib.Path.glob `, and :meth: `pathlib.Path.rglob ` silently suppress
3+ :exc: `OSError ` exceptions raised from scanning the filesystem.
You can’t perform that action at this time.
0 commit comments