summaryrefslogtreecommitdiffstats
path: root/Lib/pathlib.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2023-05-10 17:17:08 (GMT)
committerGitHub <noreply@github.com>2023-05-10 17:17:08 (GMT)
commita33ce66dca57d4c36b1022fdf3b7e322f3203468 (patch)
tree65ab2d9b7e48c20ecd03028bbd466e16b0f06c05 /Lib/pathlib.py
parent7a3b03509e5e3e72d8c47137579cccb52548a318 (diff)
downloadcpython-a33ce66dca57d4c36b1022fdf3b7e322f3203468.zip
cpython-a33ce66dca57d4c36b1022fdf3b7e322f3203468.tar.gz
cpython-a33ce66dca57d4c36b1022fdf3b7e322f3203468.tar.bz2
GH-87695: Fix OSError from `pathlib.Path.glob()` (GH-104292)
Fix issue where `pathlib.Path.glob()` raised `OSError` when it encountered a symlink to an overly long path.
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r--Lib/pathlib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index 20ec1ce..25863c7 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -178,11 +178,11 @@ class _RecursiveWildcardSelector(_Selector):
for entry in entries:
entry_is_dir = False
try:
- entry_is_dir = entry.is_dir()
+ entry_is_dir = entry.is_dir(follow_symlinks=False)
except OSError as e:
if not _ignore_error(e):
raise
- if entry_is_dir and not entry.is_symlink():
+ if entry_is_dir:
path = parent_path._make_child_relpath(entry.name)
for p in self._iterate_directories(path, scandir):
yield p