[gobject-introspection: 1/2] cachestore: don't try to catch nonexisting pickle.BadPickleGet. Fixes #159



commit 945438608433a554b8d7077af648d60a9daf59f9
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sat Dec 8 18:44:31 2018 +0100

    cachestore: don't try to catch nonexisting pickle.BadPickleGet. Fixes #159
    
    pickle.loads() can pretty much throw any kind of exception and we can't
    handle it besides ignoring it, so just catch all.

 giscanner/cachestore.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py
index 58b3193c..857dc725 100644
--- a/giscanner/cachestore.py
+++ b/giscanner/cachestore.py
@@ -178,7 +178,7 @@ class CacheStore(object):
             return None
         try:
             data = pickle.load(fd)
-        except (AttributeError, EOFError, ValueError, pickle.BadPickleGet):
+        except Exception:
             # Broken cache entry, remove it
             self._remove_filename(store_filename)
             data = None


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]