GH-77609: Add recurse_symlinks argument to pathlib.Path.glob() by barneygale · Pull Request #117311 · python/cpython (original) (raw)

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/