From e5b034b8c5b80dc9b88986ecb68520a11c8e49f6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 1 May 2021 16:56:46 +0530 Subject: [PATCH] Embedded content server: Ignore corrupted settings files --- src/calibre/srv/embedded.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/srv/embedded.py b/src/calibre/srv/embedded.py index 65558c3122..e18a097bed 100644 --- a/src/calibre/srv/embedded.py +++ b/src/calibre/srv/embedded.py @@ -6,6 +6,7 @@ import errno import json import os +from contextlib import suppress from threading import Thread from calibre import as_unicode @@ -32,7 +33,8 @@ def read_json(path): if err.errno != errno.ENOENT: raise return - return json.loads(raw) + with suppress(json.JSONDecodeError): + return json.loads(raw) def custom_list_template():