This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Chuang Men
Recipients Chuang Men
Date 2019-05-13.07:17:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557731876.23.0.465761944937.issue36898@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-05-13 07:17:56Chuang Mensetrecipients: + Chuang Men
2019-05-13 07:17:56Chuang Mensetmessageid: <1557731876.23.0.465761944937.issue36898@roundup.psfhosted.org>
2019-05-13 07:17:56Chuang Menlinkissue36898 messages
2019-05-13 07:17:56Chuang Mencreate