From 8a38e7a6e8039de93c6f24935effd89f034d9c00 Mon Sep 17 00:00:00 2001 From: Cserna Zsolt Date: Wed, 28 Oct 2020 08:27:43 +0100 Subject: Fix handling recursive symlinks When pytest was run on a directory containing a recursive symlink it failed with ELOOP as the library was not able to determine the type of the direntry: src/_pytest/main.py:685: in collect if not direntry.is_file(): E OSError: [Errno 40] Too many levels of symbolic links: '/home/florian/proj/pytest/tests/recursive' This is fixed by handling ELOOP and other errors in the visit function in pathlib.py, so the entries whose is_file() call raises an OSError with the pre-defined list of error numbers will be exluded from the result. The _ignore_errors function was copied from Lib/pathlib.py of cpython 3.9. Fixes #7951 --- AUTHORS | 1 + 1 file changed, 1 insertion(+) (limited to 'AUTHORS') diff --git a/AUTHORS b/AUTHORS index 35d220e00..f8d3d421c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -314,3 +314,4 @@ Xuecong Liao Yoav Caspi Zac Hatfield-Dodds Zoltán Máté +Zsolt Cserna -- cgit v1.2.3