diff sat/memory/cache.py @ 3572:b3fa179417e7

core (memory/cache): don't crash on EOFError in getMetadata
author Goffi <goffi@goffi.org>
date Thu, 17 Jun 2021 10:35:42 +0200
parents be6d91572633
children 2863345c9bbb
line wrap: on
line diff
--- a/sat/memory/cache.py	Wed Jun 16 13:49:26 2021 +0000
+++ b/sat/memory/cache.py	Thu Jun 17 10:35:42 2021 +0200
@@ -140,7 +140,7 @@
         try:
             with cache_url.open("rb") as f:
                 cache_data = pickle.load(f)
-        except IOError as e:
+        except (IOError, EOFError) as e:
             log.warning(f"can't read cache at {cache_url}: {e}")
             return None
         except pickle.UnpicklingError: