Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
GH-70303: Makepathlib.Path.glob('**')
return both files and directories#114684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…directoriesReturn files and directories from `pathlib.Path.glob()` if the pattern endswith `**`. This is more compatible with `PurePath.full_match()` and withother glob implementations such as bash and `glob.glob()`. Users can add atrailing slash to match only directories.In my previous patch I added a `FutureWarning` with the intention of fixingthis in Python 3.15. Upon further reflection I think this was anunnecessarily cautious remedy to a clear bug.
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.
Nice work. Love it.
Agree we can fix this, but let's make sure it's clearly mentioned in What's New and Porting Notes (also on the What's New page) for 3.13. If that's already been done, consider me +1 |
…directories (python#114684)Return files and directories from `pathlib.Path.glob()` if the pattern endswith `**`. This is more compatible with `PurePath.full_match()` and withother glob implementations such as bash and `glob.glob()`. Users can add atrailing slash to match only directories.In my previous patch I added a `FutureWarning` with the intention of fixingthis in Python 3.15. Upon further reflection I think this was anunnecessarily cautious remedy to a clear bug.
Uh oh!
There was an error while loading.Please reload this page.
Return files and directories from
pathlib.Path.glob()
if the pattern ends with**
. This is more compatible withPurePath.full_match()
and with other glob implementations such as bash andglob.glob()
. Users can add a trailing slash to match only directories.In myprevious PR I added a
FutureWarning
with the intention of fixing this in Python 3.15. Upon further reflection I think this was an unnecessarily cautious remedy to a clear bug.📚 Documentation preview 📚:https://cpython-previews--114684.org.readthedocs.build/