changeset 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 56a4a574861d
children 813595f88612 a27fd445c7c7
files sat/memory/cache.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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: