diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-03-04 02:26:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 02:26:33 (GMT) |
commit | 1dce0073da2e48f3cd387f4d57b14d6813bb8a85 (patch) | |
tree | bdfbe571b2854ce3b455f65c5148495c98995173 /Lib/pathlib/_abc.py | |
parent | 3383d6afa3e4454b237bca2ef856e0f79b5b30c1 (diff) | |
download | cpython-1dce0073da2e48f3cd387f4d57b14d6813bb8a85.zip cpython-1dce0073da2e48f3cd387f4d57b14d6813bb8a85.tar.gz cpython-1dce0073da2e48f3cd387f4d57b14d6813bb8a85.tar.bz2 |
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.
Diffstat (limited to 'Lib/pathlib/_abc.py')
-rw-r--r-- | Lib/pathlib/_abc.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pathlib/_abc.py b/Lib/pathlib/_abc.py index 44fea52..645d62a 100644 --- a/Lib/pathlib/_abc.py +++ b/Lib/pathlib/_abc.py @@ -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. |