GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `glob.glob('**/**', recursive=True)` yields duplicate results · Issue #104269 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
glob.glob('**/**', recursive=True) yields duplicate results#104269
Copy link
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@barneygale
barneygale
opened on May 7, 2023
Issue body actions

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

  • gh-104269: Document glob.glob duplicates when using multiple ** patterns #105406
  • [3.12] gh-104269: Document glob.glob duplicates when using multiple ** patterns (GH-105406) #117757

Activity

  1. barneygale
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.11only security fixesonly security fixes
    3.12only security fixesonly security fixes
    3.13only security fixesonly security fixes
    on May 7, 2023
  2. barneygale commented on May 7, 2023

    @barneygale
    barneygale
    on May 7, 2023
    ContributorAuthor
    More actions

    Reasonably minor bug I think as these patterns are pretty rare. A note in the docs might be the best solution.

  3. iritkatriel
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Nov 24, 2023
  4. serhiy-storchaka
    added this to Fnmatch and glob issueson Feb 7, 2024
  5. barneygale
    added a commit that references this issue on Mar 4, 2024

    pythonGH-106747: Prepare pathlib globbing for dir_fd support.

    6932522
  6. barneygale
    added a commit that references this issue on Apr 11, 2024

    gh-104269: Document `glob.glob` duplicates when using multiple `**` p…

    c06be6b
  7. miss-islington
    added a commit that references this issue on Apr 11, 2024

    pythongh-104269: Document `glob.glob` duplicates when using multiple …

    364cd66
  8. barneygale
    added a commit that references this issue on Apr 11, 2024

    [3.12] gh-104269: Document `glob.glob` duplicates when using multiple…

    84fb531
  9. barneygale commented on Apr 11, 2024

    @barneygale
    barneygale
    on Apr 11, 2024
    ContributorAuthor
    More actions

    Thanks for sorting this, @tomasr8!

    Reacted by Tomas R.
  10. barneygale
    closed this as completedon Apr 11, 2024
  11. github-project-automation
    moved this to Done in Fnmatch and glob issueson Apr 11, 2024
  12. diegorusso
    added a commit that references this issue on Apr 17, 2024

    pythongh-104269: Document `glob.glob` duplicates when using multiple …

    4c350d2
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 fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Fnmatch and glob issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.