From 57da1f532002f2d4ec835762aa7cbd037e2ff200 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 3 Mar 2024 14:12:33 +0000 Subject: [PATCH] Fix save-to-disk templates containing template expressions like {:'current_library_name()'} printing an exception. The exception doesn't appear to break anything, but it shouldn't be there. --- src/calibre/library/save_to_disk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/save_to_disk.py b/src/calibre/library/save_to_disk.py index 8e652a2c6a..b0a4785a80 100644 --- a/src/calibre/library/save_to_disk.py +++ b/src/calibre/library/save_to_disk.py @@ -147,7 +147,7 @@ class Formatter(TemplateFormatter): ''' def get_value(self, key, args, kwargs): - if key == '': + if not isinstance(key, str) or key == '': return '' try: key = key.lower()