Issue #26012: Don't traverse into symlinks for ** pattern in pathlib.Path.[r]glob(). (Merge 3.4->3.5)

This commit is contained in:
Guido van Rossum 2016-01-06 10:35:30 -08:00
commit 520f297eb4
3 changed files with 22 additions and 2 deletions

View file

@ -541,7 +541,7 @@ class _RecursiveWildcardSelector(_Selector):
yield parent_path
for name in listdir(parent_path):
path = parent_path._make_child_relpath(name)
if is_dir(path):
if is_dir(path) and not path.is_symlink():
for p in self._iterate_directories(path, is_dir, listdir):
yield p