diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-05-10 23:19:49 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-10 23:19:49 (GMT) |
| commit | 846a23d0b8f08e62a90682c51ce01301eb923f2e (patch) | |
| tree | 28d9d68c0f5cf1528faa197aecf35d38acc777ff /Lib/pathlib.py | |
| parent | 1cbf844875969da679f03ee4e9e27fff306fcf3d (diff) | |
| download | cpython-846a23d0b8f08e62a90682c51ce01301eb923f2e.zip cpython-846a23d0b8f08e62a90682c51ce01301eb923f2e.tar.gz cpython-846a23d0b8f08e62a90682c51ce01301eb923f2e.tar.bz2 | |
[3.11] GH-87695: Fix OSError from `pathlib.Path.glob()` (GH-104292) (GH-104362)
Fix issue where `pathlib.Path.glob()` raised `OSError` when it encountered
a symlink to an overly long path.
(cherry picked from commit a33ce66dca57d4c36b1022fdf3b7e322f3203468)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Diffstat (limited to 'Lib/pathlib.py')
| -rw-r--r-- | Lib/pathlib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 9d40d88..ecb1e8a 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -388,11 +388,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, is_dir, scandir): yield p |
