From ab222005cb000818ce24edf95120f31ce2a4de07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?tom=C3=A1s=20zerolo?= Date: Sun, 20 Nov 2022 15:00:38 +0100 Subject: [PATCH] filesizes: skip symlinks --- filesizes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filesizes.py b/filesizes.py index 893432e..69d29c9 100755 --- a/filesizes.py +++ b/filesizes.py @@ -17,7 +17,8 @@ def collectdir(direc): exit(1) for it in direc.iterdir(): - if os.access(it, os.R_OK): # ignore otherwise + if os.access(it, os.R_OK) and not it.is_symlink(): + # ignore otherwise if it.is_file(): sizes += [it.stat().st_size] elif it.is_dir(): -- 2.30.2