]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-148765: Fix description of *include_hidden* parameter in `glob.glob()`...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 6 Jul 2026 09:15:07 +0000 (11:15 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2026 09:15:07 +0000 (09:15 +0000)
(cherry picked from commit db3a4773e1e5fc1a30597d9e08bcbe41d27e5bbb)

Co-authored-by: Eoin Shaughnessy <45000144+EoinTrial@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Doc/library/glob.rst
Lib/glob.py
Misc/ACKS

index 9ce031b0133d41da5151a411076263b2f0c18886..f15a5149fd5a781e822c48658ab930745f3f79ea 100644 (file)
@@ -29,7 +29,7 @@ not by actually invoking a subshell.
    The pathnames are returned in no particular order.  If you need a specific
    order, sort the results.
 
-Files beginning with a dot (``.``) can only be matched by
+By default, files beginning with a dot (``.``) can only be matched by
 patterns that also start with a dot,
 unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
 For tilde and shell variable expansion, use :func:`os.path.expanduser` and
@@ -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, wildcards can match path segments 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
@@ -131,7 +132,7 @@ The :mod:`!glob` module defines the following functions:
    Escape all special characters (``'?'``, ``'*'`` and ``'['``).
    This is useful if you want to match an arbitrary literal string that may
    have special characters in it.  Special characters in drive/UNC
-   sharepoints are not escaped, e.g. on Windows
+   sharepoints are not escaped, for example on Windows
    ``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``.
 
    .. versionadded:: 3.4
index 64ac0ca94b2c840e9bb1c36c7ec9f0a447498a38..57d96ea61ea8662f47d8b159e1a6491ee23c5bf2 100644 (file)
@@ -34,8 +34,8 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
     If `dir_fd` is not None, it should be a file descriptor referring to a
     directory, and paths will then be relative to that directory.
 
-    If `include_hidden` is true, the patterns '*', '?', '**'  will match
-    hidden directories.
+    If `include_hidden` is true, wildcards can match path segments beginning
+    with a dot ('.').
 
     If `recursive` is true, the pattern '**' will match any files and
     zero or more directories and subdirectories.
@@ -64,8 +64,8 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
     If `dir_fd` is not None, it should be a file descriptor referring to a
     directory, and paths will then be relative to that directory.
 
-    If `include_hidden` is true, the patterns '*', '?', '**'  will match
-    hidden directories.
+    If `include_hidden` is true, wildcards can match path segments beginning
+    with a dot ('.').
 
     If `recursive` is true, the pattern '**' will match any files and
     zero or more directories and subdirectories.
index 29fc185ab3b4d06c6d6d1ab2d40c7a52ca963bc9..a0d2dc344526c0e4a6dc2190d9fe530ec4e73ad3 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1703,6 +1703,7 @@ Ha Shao
 Richard Shapiro
 Soumya Sharma
 Varun Sharma
+Eoin Shaughnessy
 Daniel Shaulov
 Vlad Shcherbina
 Justin Sheehy