summaryrefslogtreecommitdiffstats
path: root/Lib/pathlib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2016-01-06 18:31:33 (GMT)
committerGuido van Rossum <guido@python.org>2016-01-06 18:31:33 (GMT)
commit69bfb15bd8cb87dd07f1cf6c53f78b399c7ef937 (patch)
tree38aaacb57b92d4b3405b087d4cf4f5d578b3ba87 /Lib/pathlib.py
parent6c2d33a258bb62bc74be4d848968c99c6fbfbba4 (diff)
downloadcpython-69bfb15bd8cb87dd07f1cf6c53f78b399c7ef937.zip
cpython-69bfb15bd8cb87dd07f1cf6c53f78b399c7ef937.tar.gz
cpython-69bfb15bd8cb87dd07f1cf6c53f78b399c7ef937.tar.bz2
Issue #26012: Don't traverse into symlinks for ** pattern in pathlib.Path.[r]glob().
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r--Lib/pathlib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index b3303b6..cab4151 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -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