From 6fcb26ddd72e562e8a676ea64a80a48392399121 Mon Sep 17 00:00:00 2001 From: Arksine Date: Tue, 5 Jan 2021 11:27:46 -0500 Subject: [PATCH] file_manager: skip broken symlinks in list directory This resolves an issue where an exception is raised when path info is requested. Signed-off-by: Eric Callahan --- moonraker/plugins/file_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moonraker/plugins/file_manager.py b/moonraker/plugins/file_manager.py index 955af60..f69ca8c 100644 --- a/moonraker/plugins/file_manager.py +++ b/moonraker/plugins/file_manager.py @@ -280,6 +280,8 @@ class FileManager: flist = {'dirs': [], 'files': []} for fname in os.listdir(path): full_path = os.path.join(path, fname) + if not os.path.exists(full_path): + continue path_info = self._get_path_info(full_path) if os.path.isdir(full_path): path_info['dirname'] = fname