From 7cb7eebbc50075ec4b171347403d5f15690fd6c5 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 11 Jul 2023 10:44:54 +0200 Subject: [PATCH] Browser Steps - When cleaning up old screenshots, check the file exists --- changedetectionio/content_fetcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index d4d593a1..db9e23dc 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -201,7 +201,8 @@ class Fetcher(): dest = os.path.join(self.browser_steps_screenshot_path, 'step_*.jpeg') files = glob.glob(dest) for f in files: - os.unlink(f) + if os.path.isfile(f): + os.unlink(f) # Maybe for the future, each fetcher provides its own diff output, could be used for text, image