mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Also ignore unserializable settings when migrating pickle files
This commit is contained in:
parent
7f4ca92b5a
commit
d0d609c715
@ -203,8 +203,7 @@ class DynamicConfig(dict):
|
||||
'''
|
||||
A replacement for QSettings that supports dynamic config keys.
|
||||
Returns `None` if a config key is not found. Note that the config
|
||||
data is stored in a non human readable pickle file, so only use this
|
||||
class for preferences that you don't intend to have the users edit directly.
|
||||
data is stored in a JSON file.
|
||||
'''
|
||||
|
||||
def __init__(self, name='dynamic'):
|
||||
@ -257,7 +256,7 @@ class DynamicConfig(dict):
|
||||
d = self.read_old_serialized_representation()
|
||||
migrate = bool(d)
|
||||
if migrate and d:
|
||||
raw = json_dumps(d)
|
||||
raw = json_dumps(d, ignore_unserializable=True)
|
||||
with ExclusiveFile(self.file_path) as f:
|
||||
f.seek(0), f.truncate()
|
||||
f.write(raw)
|
||||
|
Loading…
x
Reference in New Issue
Block a user