diff --git a/senpy/plugins/__init__.py b/senpy/plugins/__init__.py index b45a7f4..a02465d 100644 --- a/senpy/plugins/__init__.py +++ b/senpy/plugins/__init__.py @@ -96,7 +96,10 @@ class ShelfMixin(object): if not hasattr(self, '_sh') or self._sh is None: self.__dict__['_sh'] = {} if os.path.isfile(self.shelf_file): - self.__dict__['_sh'] = pickle.load(open(self.shelf_file, 'rb')) + try: + self.__dict__['_sh'] = pickle.load(open(self.shelf_file, 'rb')) + except EOFError: + logger.warning('corrupted shelf file!') return self._sh @sh.deleter