Merge pull request #2904 from GiovanH/pickle-typeerror

Pickle.dump can raise TypeError (e.g. generators)
This commit is contained in:
Justin Mayer 2021-09-29 12:58:46 +02:00 committed by GitHub
commit 24aefd3b1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,7 +65,7 @@ class FileDataCacher:
mkdir_p(self.settings['CACHE_PATH'])
with self._cache_open(self._cache_path, 'wb') as fhandle:
pickle.dump(self._cache, fhandle)
except (OSError, pickle.PicklingError) as err:
except (OSError, pickle.PicklingError, TypeError) as err:
logger.warning('Could not save cache %s\n ... %s',
self._cache_path, err)