mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Embedded content server: Ignore corrupted settings files
This commit is contained in:
parent
d8d1d890ea
commit
e5b034b8c5
@ -6,6 +6,7 @@
|
|||||||
import errno
|
import errno
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
from contextlib import suppress
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
from calibre import as_unicode
|
from calibre import as_unicode
|
||||||
@ -32,7 +33,8 @@ def read_json(path):
|
|||||||
if err.errno != errno.ENOENT:
|
if err.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
return
|
return
|
||||||
return json.loads(raw)
|
with suppress(json.JSONDecodeError):
|
||||||
|
return json.loads(raw)
|
||||||
|
|
||||||
|
|
||||||
def custom_list_template():
|
def custom_list_template():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user