Skip to content

GH-77609: Add recurse_symlinks argument to pathlib.Path.glob() #117311

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Mar 28, 2024

Replace tri-state follow_symlinks with boolean recurse_symlinks argument. The new argument controls whether symlinks are followed when expanding recursive ** wildcards. The possible argument values correspond as follows:

follow_symlinks  recurse_symlinks
===============  ================
False            N/A
None             False
True             True

We therefore drop support for not following symlinks when expanding non-recursive pattern parts; it wasn't requested in the original issue, and it's a feature not found in any shells.

This makes the API a easier to grok by eliminating None as an option.

No news blurb as follow_symlinks was new in 3.13.


📚 Documentation preview 📚: https://cpython-previews--117311.org.readthedocs.build/

Replace tri-state `follow_symlinks` with boolean `recurse_symlinks`
argument. The new argument controls whether symlinks are followed when
expanding recursive `**` wildcards. The arguments correspond as follows:

    follow_symlinks  recurse_symlinks
    ===============  ================
    False            N/A
    None             False
    True             True
@barneygale
Copy link
Contributor Author

@barneygale barneygale enabled auto-merge (squash) April 5, 2024 18:23
@barneygale barneygale merged commit 6150bb2 into python:main Apr 5, 2024
33 checks passed
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
python#117311)

Replace tri-state `follow_symlinks` with boolean `recurse_symlinks` argument. The new argument controls whether symlinks are followed when expanding recursive `**` wildcards. The possible argument values correspond as follows:

    follow_symlinks  recurse_symlinks
    ===============  ================
    False            N/A
    None             False
    True             True

We therefore drop support for not following symlinks when expanding non-recursive pattern parts; it wasn't requested in the original issue, and it's a feature not found in any shells.

This makes the API a easier to grok by eliminating `None` as an option.

No news blurb as `follow_symlinks` was new in 3.13.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant