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 — bpo-36898: Add parameter @case_sensitive to glob and rglob in pathlib by monchin · Pull Request #13274 · python/cpython

Conversation

@monchin

@monchin monchin commented May 13, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

https://bugs.python.org/issue36898

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@monchin
Add parameter @case_sensitive to glob and rglob
9782899
@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label May 13, 2019
@the-knights-who-say-ni

the-knights-who-say-ni commented May 13, 2019

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting review label May 13, 2019
@monchin monchin changed the title Add parameter @case_sensitive to glob and rglob in pathlib bpo-36898: Add parameter @case_sensitive to glob and rglob in pathlib May 13, 2019
eamanu
eamanu suggested changes May 14, 2019
View reviewed changes

@eamanu eamanu left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is a good improve.

You need to write tests and NEW file.

Don't forget sign the CLA :-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels May 14, 2019
@brettcannon brettcannon removed the CLA not signed label Aug 8, 2019
@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Aug 8, 2019
@brettcannon

brettcannon commented Aug 8, 2019

Copy link
Copy Markdown
Member

Thanks for the PR, but closing as the CLA has not been signed within the last month. If you do decide to sign the CLA we can re-open this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon brettcannon closed this Aug 8, 2019
@ChuangMen ChuangMen mannequin mentioned this pull request Apr 10, 2022
Add parameter @case_sensitive to glob and rglob in pathlib #81079
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@eamanu eamanu eamanu requested changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@monchin @the-knights-who-say-ni @brettcannon @eamanu @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.