mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-20 15:56:16 +01:00
Also ignore unserializable settings when migrating pickle files
This commit is contained in:
parent
7f4ca92b5a
commit
d0d609c715
1 changed files with 2 additions and 3 deletions
|
|
@ -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 @@ def refresh(self, clear_current=True):
|
|||
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…
Reference in a new issue