diff --git a/src/calibre/ebooks/conversion/utils.py b/src/calibre/ebooks/conversion/utils.py index 86a4668b9b..4822eee6ae 100644 --- a/src/calibre/ebooks/conversion/utils.py +++ b/src/calibre/ebooks/conversion/utils.py @@ -5,7 +5,7 @@ __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import re +import re, error as re_error from math import ceil from calibre.ebooks.conversion.preprocess import DocAnalysis, Dehyphenator from calibre.utils.logging import default_log @@ -148,7 +148,7 @@ class HeuristicProcessor(object): return wordcount.words def markup_italicis(self, html): - self.log.debug("\n\n\nitalicize debugging \n\n\n") + #self.log.debug("\n\n\nitalicize debugging \n\n\n") ITALICIZE_WORDS = [ 'Etc.', 'etc.', 'viz.', 'ie.', 'i.e.', 'Ie.', 'I.e.', 'eg.', 'e.g.', 'Eg.', 'E.g.', 'et al.', 'et cetera', 'n.b.', 'N.b.', @@ -184,6 +184,9 @@ class HeuristicProcessor(object): except OverflowError: # match.group(0) was too large to be compiled into a regex continue + except re_error: + # the match was not a valid regular expression + continue return html