Skip to content

Commit 8e060bb

Browse files
miss-islingtonEoinTrialStanFromIreland
authored
[3.13] gh-148765: Fix description of *include_hidden* parameter in glob.glob() docs (GH-148768) (#153172)
(cherry picked from commit db3a477) Co-authored-by: Eoin Shaughnessy <45000144+EoinTrial@users.noreply.github.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent e9f8969 commit 8e060bb

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

Doc/library/glob.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ not by actually invoking a subshell.
2929
The pathnames are returned in no particular order. If you need a specific
3030
order, sort the results.
3131

32-
Files beginning with a dot (``.``) can only be matched by
32+
By default, files beginning with a dot (``.``) can only be matched by
3333
patterns that also start with a dot,
3434
unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
3535
For tilde and shell variable expansion, use :func:`os.path.expanduser` and
@@ -70,7 +70,8 @@ The :mod:`!glob` module defines the following functions:
7070
pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not
7171
match.
7272

73-
If *include_hidden* is true, "``**``" pattern will match hidden directories.
73+
If *include_hidden* is true, wildcards can match path segments that
74+
begin with a dot (``.``).
7475

7576
.. audit-event:: glob.glob pathname,recursive glob.glob
7677
.. 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:
131132
Escape all special characters (``'?'``, ``'*'`` and ``'['``).
132133
This is useful if you want to match an arbitrary literal string that may
133134
have special characters in it. Special characters in drive/UNC
134-
sharepoints are not escaped, e.g. on Windows
135+
sharepoints are not escaped, for example on Windows
135136
``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``.
136137

137138
.. versionadded:: 3.4

Lib/glob.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
3434
If `dir_fd` is not None, it should be a file descriptor referring to a
3535
directory, and paths will then be relative to that directory.
3636
37-
If `include_hidden` is true, the patterns '*', '?', '**' will match
38-
hidden directories.
37+
If `include_hidden` is true, wildcards can match path segments beginning
38+
with a dot ('.').
3939
4040
If `recursive` is true, the pattern '**' will match any files and
4141
zero or more directories and subdirectories.
@@ -64,8 +64,8 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
6464
If `dir_fd` is not None, it should be a file descriptor referring to a
6565
directory, and paths will then be relative to that directory.
6666
67-
If `include_hidden` is true, the patterns '*', '?', '**' will match
68-
hidden directories.
67+
If `include_hidden` is true, wildcards can match path segments beginning
68+
with a dot ('.').
6969
7070
If `recursive` is true, the pattern '**' will match any files and
7171
zero or more directories and subdirectories.

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,7 @@ Ha Shao
17031703
Richard Shapiro
17041704
Soumya Sharma
17051705
Varun Sharma
1706+
Eoin Shaughnessy
17061707
Daniel Shaulov
17071708
Vlad Shcherbina
17081709
Justin Sheehy

0 commit comments

Comments
 (0)