pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/148288/files

nymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-2d31826944fd3be8.css" /> [3.14] gh-146646: Document that glob functions suppress OSError (GH-147996) by miss-islington · Pull Request #148288 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Doc/library/glob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ The :mod:`!glob` module defines the following functions:
This function may return duplicate path names if *pathname*
contains multiple "``**``" patterns and *recursive* is true.

.. note::
Any :exc:`OSError` exceptions raised from scanning the filesystem are
suppressed. This includes :exc:`PermissionError` when accessing
directories without read permission.

.. versionchanged:: 3.5
Support for recursive globs using "``**``".

Expand All @@ -106,6 +111,11 @@ The :mod:`!glob` module defines the following functions:
This function may return duplicate path names if *pathname*
contains multiple "``**``" patterns and *recursive* is true.

.. note::
Any :exc:`OSError` exceptions raised from scanning the filesystem are
suppressed. This includes :exc:`PermissionError` when accessing
directories without read permission.

.. versionchanged:: 3.5
Support for recursive globs using "``**``".

Expand Down
10 changes: 10 additions & 0 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,11 @@ Reading directories
``False``, this method follows symlinks except when expanding "``**``"
wildcards. Set *recurse_symlinks* to ``True`` to always follow symlinks.

.. note::
Any :exc:`OSError` exceptions raised from scanning the filesystem are
suppressed. This includes :exc:`PermissionError` when accessing
directories without read permission.

.. audit-event:: pathlib.Path.glob self,pattern pathlib.Path.glob

.. versionchanged:: 3.12
Expand All @@ -1391,6 +1396,11 @@ Reading directories
The paths are returned in no particular order.
If you need a specific order, sort the results.

.. note::
Any :exc:`OSError` exceptions raised from scanning the filesystem are
suppressed. This includes :exc:`PermissionError` when accessing
directories without read permission.

.. seealso::
:ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Document that :func:`glob.glob`, :func:`glob.iglob`,
:meth:`pathlib.Path.glob`, and :meth:`pathlib.Path.rglob` silently suppress
:exc:`OSError` exceptions raised from scanning the filesystem.
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy