Commit e042d6bb authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Pickle functions sometimes raise EOFError

parent 73b415bd
...@@ -372,7 +372,7 @@ class Settings(object): ...@@ -372,7 +372,7 @@ class Settings(object):
try: try:
with open(configFile, 'rb') as f: with open(configFile, 'rb') as f:
return pickle.load(f) return pickle.load(f)
except (IOError, pickle.UnpicklingError): except (IOError, pickle.UnpicklingError, EOFError):
log.debug('Unable to load stored {} configuration file ' log.debug('Unable to load stored {} configuration file '
'{}'.format(self.__configID, configFile), '{}'.format(self.__configID, configFile),
exc_info=True) exc_info=True)
...@@ -391,7 +391,7 @@ class Settings(object): ...@@ -391,7 +391,7 @@ class Settings(object):
try: try:
with open(configFile, 'wb') as f: with open(configFile, 'wb') as f:
pickle.dump(config, f) pickle.dump(config, f)
except (IOError, pickle.PicklingError): except (IOError, pickle.PicklingError, EOFError):
log.warning('Unable to save {} configuration file ' log.warning('Unable to save {} configuration file '
'{}'.format(self.__configID, configFile), '{}'.format(self.__configID, configFile),
exc_info=True) exc_info=True)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment