Calling `glob.glob(pattern, recursive=True)`, where *pattern* contains two or more `**/` segments, can yield the same paths multiple times: ```python >>> import glob >>> len(glob.glob('**/**', recursive=True)) 314206 >>> len(set(glob.glob('**/**', recursive=True))) 44849 ``` <!-- gh-linked-prs --> ### Linked PRs * gh-105406 * gh-117757 <!-- /gh-linked-prs -->
Activity
barneygale commentedon May 7, 2023
Reasonably minor bug I think as these patterns are pretty rare. A note in the docs might be the best solution.
pythonGH-106747: Prepare pathlib globbing for dir_fd support.
gh-104269: Document `glob.glob` duplicates when using multiple `**` p…
pythongh-104269: Document `glob.glob` duplicates when using multiple …
[3.12] gh-104269: Document `glob.glob` duplicates when using multiple…
barneygale commentedon Apr 11, 2024
Thanks for sorting this, @tomasr8!
pythongh-104269: Document `glob.glob` duplicates when using multiple …