From d26964ab085071f6e52ccd723c16c56fc3ca0454 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 8 Jul 2024 12:46:23 +0200 Subject: [PATCH] Added log message for missing python magic --- cps/file_helper.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cps/file_helper.py b/cps/file_helper.py index ff0bebea..095b5ee0 100644 --- a/cps/file_helper.py +++ b/cps/file_helper.py @@ -22,15 +22,16 @@ import shutil import zipfile import mimetypes from io import BytesIO -try: - import magic -except ImportError: - pass from . import logger log = logger.create() +try: + import magic +except ImportError as e: + log.error("Cannot import python-magic, checking uploaded file metadata will not work: %s", e) + def get_temp_dir(): tmp_dir = os.path.join(gettempdir(), 'calibre_web')