mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Handle failure to parse to decode config files gracefully.
This commit is contained in:
parent
736e643f9f
commit
91c7ac997c
@ -411,7 +411,11 @@ class Config(ConfigInterface):
|
||||
if os.path.exists(self.config_file_path):
|
||||
try:
|
||||
with ExclusiveFile(self.config_file_path) as f:
|
||||
src = f.read().decode('utf-8')
|
||||
try:
|
||||
src = f.read().decode('utf-8')
|
||||
except ValueError:
|
||||
print "Failed to parse", self.config_file_path
|
||||
traceback.print_exc()
|
||||
except LockError:
|
||||
raise IOError('Could not lock config file: %s'%self.config_file_path)
|
||||
return self.option_set.parse_string(src)
|
||||
|
Loading…
x
Reference in New Issue
Block a user