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

This commit is contained in:
Guido van Rossum 2016-01-06 10:31:33 -08:00
parent 6c2d33a258
commit 69bfb15bd8
3 changed files with 22 additions and 2 deletions

View file

@ -496,7 +496,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