From 3fd9be15d2405fcb585757b9376126bb9433e976 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Feb 2011 00:24:52 -0700 Subject: [PATCH] ... --- src/calibre/utils/cleantext.py | 2 ++ 1 file changed, 2 insertions(+) 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))