From a362ee22468ea29a12320c824d5c1859a888f271 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 27 Jul 2021 00:28:40 +0200 Subject: [PATCH] dodge a bullet on centos7 --- copyparty/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/copyparty/util.py b/copyparty/util.py index a75cb328..38b31654 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -1034,11 +1034,13 @@ def sendfile_kern(lower, upper, f, s): def statdir(logger, scandir, lstat, top): + if lstat and not os.supports_follow_symlinks: + scandir = False + try: btop = fsenc(top) if scandir and hasattr(os, "scandir"): src = "scandir" - lstat = lstat and os.supports_follow_symlinks with os.scandir(btop) as dh: for fh in dh: try: