From 0d775490b02929c0d35bad875480b1477a34a4fc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 11 Mar 2022 12:25:18 +0530 Subject: [PATCH] Ignore corrupted reading rates json file --- src/calibre/gui2/viewer/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/config.py b/src/calibre/gui2/viewer/config.py index 02646ac499..94687cafcd 100644 --- a/src/calibre/gui2/viewer/config.py +++ b/src/calibre/gui2/viewer/config.py @@ -68,5 +68,8 @@ def load_reading_rates(key): except OSError: existing = {} else: - existing = json.loads(raw) + try: + existing = json.loads(raw) + except Exception: + existing = {} return existing.get(key)