Bug description
The documentation for glob.glob() and glob.iglob() describes the include_hidden parameter as:
If include_hidden is true, "**" pattern will match hidden directories.
This is inaccurate in two ways:
- The flag affects all wildcard patterns (
*, ?, [...], **), not just **.
For example, glob.glob('*',include_hidden=True) matches dotfiles in the current directory.
- "hidden directories" is misleading, since it refers to any path component whose name begins with a dot, not Windows
FILE_ATTRIBUTE_HIDDEN.
This was raised on Python Discourse in September 2022 (https://discuss.python.org/t/new-glob-documentation-could-be-improved/19054) where @eryksun suggested the fix and @gvanrossum asked for an issue and PR.
The correct description (matching the wording already used in glob.translate() on line 164 of the same file) would be:
If include_hidden is true, patterns that do not begin with a dot may also match path components that begin with a dot.
CPython versions tested on:
3.11, 3.12, 3.13, 3.14
Operating systems tested on:
Any
Linked PRs
Bug description
The documentation for
glob.glob()andglob.iglob()describes theinclude_hiddenparameter as:This is inaccurate in two ways:
*,?,[...],**), not just**.For example,
glob.glob('*',include_hidden=True)matches dotfiles in the current directory.FILE_ATTRIBUTE_HIDDEN.This was raised on Python Discourse in September 2022 (https://discuss.python.org/t/new-glob-documentation-could-be-improved/19054) where @eryksun suggested the fix and @gvanrossum asked for an issue and PR.
The correct description (matching the wording already used in
glob.translate()on line 164 of the same file) would be:CPython versions tested on:
3.11, 3.12, 3.13, 3.14
Operating systems tested on:
Any
Linked PRs
include_hiddenparameter in glob docs #148768