From 61d30bce0c38d7d9f7d95732e059742c9aa62e96 Mon Sep 17 00:00:00 2001 From: Eoin Shaughnessy Date: Sun, 19 Apr 2026 20:32:28 +0100 Subject: [PATCH] gh-148765: Fix description of include_hidden parameter in glob docs --- Doc/library/glob.rst | 3 ++- .../2026-04-19-20-31-27.gh-issue-148765.SNB_1A.rst | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Documentation/2026-04-19-20-31-27.gh-issue-148765.SNB_1A.rst diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst index 942f23d216fc07..aa068209e949c1 100644 --- a/Doc/library/glob.rst +++ b/Doc/library/glob.rst @@ -70,7 +70,8 @@ The :mod:`!glob` module defines the following functions: pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not match. - If *include_hidden* is true, "``**``" pattern will match hidden directories. + If *include_hidden* is true, patterns that do not begin with a dot (``.``) + may also match path components that begin with a dot. .. audit-event:: glob.glob pathname,recursive glob.glob .. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob diff --git a/Misc/NEWS.d/next/Documentation/2026-04-19-20-31-27.gh-issue-148765.SNB_1A.rst b/Misc/NEWS.d/next/Documentation/2026-04-19-20-31-27.gh-issue-148765.SNB_1A.rst new file mode 100644 index 00000000000000..496c9daca0cea7 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2026-04-19-20-31-27.gh-issue-148765.SNB_1A.rst @@ -0,0 +1,12 @@ +Fix inaccurate description of the *include_hidden* parameter in +:func:`glob.glob` and :func:`glob.iglob`. The parameter allows all wildcard +patterns to match path components beginning with a dot, not just ``**`` +matching "hidden directories" as previously stated. + +#.. section: Tests #.. section: Build #.. section: Windows #.. section: +macOS #.. section: IDLE #.. section: Tools/Demos #.. section: C API + +# Write your Misc/NEWS.d entry below. It should be a simple ReST paragraph. +# Don't start with "- Issue #: " or "- gh-issue-: " or that sort of +stuff. +###########################################################################