mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
pathlib ABCs: follow all symlinks in PathBase.glob()
(#116293)
Switch the default value of *follow_symlinks* from `None` to `True` in `pathlib._abc.PathBase.glob()` and `rglob()`. This speeds up recursive globbing. No change to the public pathlib classes.
This commit is contained in:
parent
3383d6afa3
commit
1dce0073da
2 changed files with 35 additions and 40 deletions
|
@ -789,7 +789,7 @@ class PathBase(PurePathBase):
|
|||
def _make_child_relpath(self, name):
|
||||
return self.joinpath(name)
|
||||
|
||||
def glob(self, pattern, *, case_sensitive=None, follow_symlinks=None):
|
||||
def glob(self, pattern, *, case_sensitive=None, follow_symlinks=True):
|
||||
"""Iterate over this subtree and yield all existing files (of any
|
||||
kind, including directories) matching the given relative pattern.
|
||||
"""
|
||||
|
@ -846,7 +846,7 @@ class PathBase(PurePathBase):
|
|||
paths = _select_children(paths, bool(stack), follow_symlinks, match)
|
||||
return paths
|
||||
|
||||
def rglob(self, pattern, *, case_sensitive=None, follow_symlinks=None):
|
||||
def rglob(self, pattern, *, case_sensitive=None, follow_symlinks=True):
|
||||
"""Recursively yield all existing files (of any kind, including
|
||||
directories) matching the given relative pattern, anywhere in
|
||||
this subtree.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue