From 90ee3a598763d1a8bd23018b83212cee0a2ccce9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Sep 2018 07:09:01 +0530 Subject: [PATCH] Dont allow a failure to exec() downloaded metadata source plugins to prevent metadata download from working --- src/calibre/ebooks/metadata/sources/update.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/update.py b/src/calibre/ebooks/metadata/sources/update.py index c6b7292fd9..a2403d65a1 100644 --- a/src/calibre/ebooks/metadata/sources/update.py +++ b/src/calibre/ebooks/metadata/sources/update.py @@ -59,8 +59,12 @@ def patch_search_engines(src): global current_search_engines src = src.encode('utf-8') ns = {} - exec(src, ns) - mcv = ns.get('minimum_calibre_version') + try: + exec(src, ns) + except Exception: + mcv = None + else: + mcv = ns.get('minimum_calibre_version') if mcv is None or mcv > numeric_version: return cv = ns.get('current_version')