From 54909e3a599e8ea42500d51788ee2ef27fd63d4f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 5 Dec 2014 18:54:26 +0530 Subject: [PATCH] More robust against buggy FileType plugins on book import --- src/calibre/ebooks/metadata/worker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/worker.py b/src/calibre/ebooks/metadata/worker.py index 08acd8a71e..b8954a2023 100644 --- a/src/calibre/ebooks/metadata/worker.py +++ b/src/calibre/ebooks/metadata/worker.py @@ -36,7 +36,12 @@ def run_import_plugins(paths, group_id, tdir): for path in paths: if not os.access(path, os.R_OK): continue - nfp = run_plugins_on_import(path) + try: + nfp = run_plugins_on_import(path) + except Exception: + nfp = None + import traceback + traceback.print_exc() if nfp and os.access(nfp, os.R_OK) and not samefile(nfp, path): # Ensure that the filename is preserved so that # reading metadata from filename is not broken