BPO | [35201](https://bugs.python.org/issue35201) --- | :--- Nosy | @serhiy-storchaka *Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.* Show more details GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['type-bug', 'library', '3.9', '3.10', '3.11'] title = "Recursive '**' matches non-existent directories." updated_at = user = 'https://bugs.python.org/daniel' ``` bugs.python.org fields: ```python activity = actor = 'iritkatriel' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'daniel' dependencies = [] files = [] hgrepos = [] issue_num = 35201 keywords = [] message_count = 3.0 messages = ['329537', '329539', '329703'] nosy_count = 2.0 nosy_names = ['serhiy.storchaka', 'daniel'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'open' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue35201' versions = ['Python 3.9', 'Python 3.10', 'Python 3.11'] ``` ### Linked PRs * gh-115134 * gh-115290 * gh-115291
Activity
daniel commentedon Nov 9, 2018
In the following case, when there is no file or directory 'a', glob will still return it:
Note that this is inconsistent with the '*' pattern:
serhiy-storchaka commentedon Nov 9, 2018
This is expected behavior, and it matches the behavior of Bash.
"**" matches zero or more path components. In this case case it matches zero.
daniel commentedon Nov 12, 2018
In the Bash example, you created the directory empty/. This bug is specifically when the directory in question does not exist.
LuckyDams commentedon May 24, 2022
Similar issue with existing file returned as directory:
pythongh-79382: Fix recursive glob() with trailing "**"
gh-79382: Fix recursive glob() with trailing "**" (GH-115134)
pythongh-79382: Fix recursive glob() with trailing "**" (pythonGH-115134
pythongh-79382: Fix recursive glob() with trailing "**" (pythonGH-115134
[3.12] gh-79382: Fix recursive glob() with trailing "**" (GH-115134) (G…
[3.11] gh-79382: Fix recursive glob() with trailing "**" (GH-115134) (G…
pythongh-79382: Fix recursive glob() with trailing "**" (pythonGH-115134