From: Michael Tremer Date: Tue, 11 Feb 2025 16:39:18 +0000 (+0000) Subject: backend: Catch non-existant files on stat() X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=efb7f49a3540ddce6dd3552528c7c2b39f1ea328;p=pbs.git backend: Catch non-existant files on stat() Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index 3aff14de..d69b17d3 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -385,7 +385,12 @@ class Backend(object): path = self.path(path) # Stat the file - s = os.stat(path) + try: + s = os.stat(path) + + # Return nothing if the file does not exist + except FileNotFoundError as e: + return # Check if the format matches if fmt: