Skip to content

glob.glob('**/**', recursive=True) yields duplicate results #104269

Description

@barneygale

Calling glob.glob(pattern, recursive=True), where pattern contains two or more **/ segments, can yield the same paths multiple times:

>>> import glob
>>> len(glob.glob('**/**', recursive=True))
314206
>>> len(set(glob.glob('**/**', recursive=True)))
44849

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions