diff --git a/src/calibre/utils/cleantext.py b/src/calibre/utils/cleantext.py index f421fdcba2..89101a6219 100644 --- a/src/calibre/utils/cleantext.py +++ b/src/calibre/utils/cleantext.py @@ -12,6 +12,8 @@ def clean_ascii_chars(txt, charlist=None): Remove ASCII control chars: 0 to 8 and 11, 12, 14-31 by default This is all control chars except \\t,\\n and \\r ''' + if not txt: + return '' global _ascii_pat if _ascii_pat is None: chars = list(range(8)) + [0x0B, 0x0C] + list(range(0x0E, 0x1F))