Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
barneygale merged 2 commits intopython:mainfrombarneygale:gh-70303
Jan 30, 2024

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedJan 28, 2024
edited
Loading

Return files and directories frompathlib.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 aFutureWarning 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/

…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.
Copy link
Member

@jaracojaraco left a 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.

barneygale reacted with heart emoji
@zooba
Copy link
Member

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

barneygale reacted with thumbs up emoji

@barneygalebarneygale merged commitfda7445 intopython:mainJan 30, 2024
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
…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.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jaracojaracojaraco approved these changes

@zoobazoobaAwaiting requested review from zooba

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@barneygale@zooba@jaraco

[8]ページ先頭

©2009-2025 Movatter.jp