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 — Add parameter @case_sensitive to glob and rglob in pathlib · Issue #81079 · python/cpython

Add parameter @case_sensitive to glob and rglob in pathlib #81079

New issue
Copy link
New issue
Copy link
Closed
Closed
Add parameter @case_sensitive to glob and rglob in pathlib#81079
Copy link
Labels
3.8 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement

Description

ChuangMen
mannequin
opened on May 13, 2019
Issue body actions
BPO 36898
Nosy @serhiy-storchaka
PRs
  • bpo-36898: Add parameter @case_sensitive to glob and rglob in pathlib #13274
  • Files
  • pathlib.py
  • 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:

    assignee = None
    closed_at = None
    created_at = <Date 2019-05-13.07:17:56.195>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Add parameter @case_sensitive to glob and rglob in pathlib'
    updated_at = <Date 2019-05-13.07:58:11.844>
    user = 'https://bugs.python.org/ChuangMen'

    bugs.python.org fields:

    activity = <Date 2019-05-13.07:58:11.844>
    actor = 'Chuang Men'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2019-05-13.07:17:56.195>
    creator = 'Chuang Men'
    dependencies = []
    files = ['48328']
    hgrepos = []
    issue_num = 36898
    keywords = []
    message_count = 3.0
    messages = ['342284', '342287', '342289']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'Chuang Men']
    pr_nums = ['13274']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36898'
    versions = ['Python 3.8']

    Linked PRs

    • GH-81079: Add case_sensitive argument to pathlib.Path.glob() #102710

    Activity

    1. ChuangMen commented on May 13, 2019

      @ChuangMen
      ChuangMenmannequin
      on May 13, 2019
      MannequinAuthor
      More actions

      In pathlib, I add a parameter @case_sensitive to glob and rglob.

      Sometimes the extension would be in upper case but sometimes it would be lower case, for example: *.tif and *.TIF. So the parameter @case_sensitive may be useful in some cases.

      Usage example:
      In [1]: from pathlib import Path

      In [2]: path = Path('.')

      In [3]: for each_file in path.glob('*.tif'):
      ...: print(each_file)
      ...:
      a.tif
      b.tif

      In [4]: for each_file in path.rglob('*.TIF'):
      ...: print(each_file)
      ...:
      c.TIF
      TEST/d.TIF

      In [5]: for each_file in path.glob('*.TIF', case_sensitive=False):
      ...: print(each_file)
      ...:
      a.tif
      c.TIF
      b.tif

      In [6]: for each_file in path.rglob('*.TIF', case_sensitive=False):
      ...: print(each_file)
      ...:
      a.tif
      c.TIF
      b.tif
      TEST/d.TIF
      TEST/e.tif

    2. ChuangMen
      added
      3.7 (EOL)end of lifeend of life
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancementA feature request or enhancement
      on May 13, 2019
    3. SilentGhost
      added
      3.8 (EOL)end of lifeend of life
      and removed
      3.7 (EOL)end of lifeend of life
      on May 13, 2019
    4. serhiy-storchaka commented on May 13, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on May 13, 2019
      Member
      More actions

      You can use the pattern '*.[Tt][Ii][Ff]'.

    5. ChuangMen commented on May 13, 2019

      @ChuangMen
      ChuangMenmannequin
      on May 13, 2019
      MannequinAuthor
      More actions

      It is a good solution but when pattern is long, it might be a little inconvenient.
      Anyway, just an advice. Thank you for your reply!

    6. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    7. serhiy-storchaka
      added this to Fnmatch and glob issueson May 19, 2022
    8. brettcannon
      added
      topic-pathlib
      on Jun 21, 2022
    9. barneygale
      added a commit that references this issue on Mar 12, 2023

      pythonGH-77609: Support following symlinks in `pathlib.Path.glob()`

      59dcdb1
    10. barneygale commented on Mar 12, 2023

      @barneygale
      barneygale
      on Mar 12, 2023
      Contributor
      More actions

      This should be straightforward to add once #102616 lands.

    11. barneygale
      added a commit that references this issue on Mar 15, 2023

      pythonGH-81079: Add case_sensitive argument to pathlib.Path.glob()

      b0d836e
    12. barneygale commented on Mar 15, 2023

      @barneygale
      barneygale
      on Mar 15, 2023
      Contributor
      More actions

      PR available: #102710

    13. barneygale
      added 2 commits that reference this issue on Mar 22, 2023

      Merge branch 'main' into pythongh-81079-glob-case-sensitive-arg-2

      e386a54

      Merge branch 'main' into pythongh-81079-glob-case-sensitive-arg-2

      29cdbee
    14. barneygale
      added 6 commits that reference this issue on Apr 29, 2023

      Merge branch 'main' into pythongh-81079-glob-case-sensitive-arg-2

      ac1fe16

      Merge branch 'main' into pythongh-81079-glob-case-sensitive-arg-2

      c411cfa

      pythonGH-104114: Fix `pathlib.WindowsPath.glob()` use of literal patt…

      1f58b94

      GH-104114: Fix `pathlib.WindowsPath.glob()` use of literal pattern se…

      da1980a

      Merge branch 'main' into pythongh-81079-glob-case-sensitive-arg-2

      37d2e20

      GH-81079: Add case_sensitive argument to `pathlib.Path.glob()` (GH-10…

      8100be5
    15. barneygale commented on May 4, 2023

      @barneygale
      barneygale
      on May 4, 2023
      Contributor
      More actions

      Implemented in 3.12: #102710 / 8100be5

    16. barneygale
      closed this as completedon May 4, 2023
    17. github-project-automation
      moved this to Done in Fnmatch and glob issueson May 4, 2023
    18. carljm
      added a commit that references this issue on May 5, 2023

      Merge branch 'main' into inlinecomp2

      8a78a36
    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.8 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement

      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.