]> git.ipfire.org Git - pbs.git/commitdiff
backend: Catch non-existant files on stat()
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Feb 2025 16:39:18 +0000 (16:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Feb 2025 16:39:18 +0000 (16:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/__init__.py

index 3aff14deada13be937df47e25af5864ae37349a1..d69b17d3ed6396e4550685f5303f061f81270be7 100644 (file)
@@ -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: