From 571221b4bdb0e0c2b23e15e45845cce4d8ddcbf4 Mon Sep 17 00:00:00 2001 From: heliguy Date: Sat, 2 Sep 2023 02:54:31 -0400 Subject: [PATCH] Fix errors in file size for properties window When getting the size of directory, the function now skips symlinks to prevernt errors --- src/window.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/window.py b/src/window.py index 6398d51..6292f26 100644 --- a/src/window.py +++ b/src/window.py @@ -90,6 +90,8 @@ class FlattoolGuiWindow(Adw.ApplicationWindow): try: # print("[+] Getting the size of", directory) for entry in os.scandir(directory): + if entry.is_symlink(): + continue # Skip symlinks if entry.is_file(): # if it's a file, use stat() function total += entry.stat().st_size