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()