diff --git a/src/calibre/ebooks/txt/txtml.py b/src/calibre/ebooks/txt/txtml.py index a6bdd91226..f70a011e2d 100644 --- a/src/calibre/ebooks/txt/txtml.py +++ b/src/calibre/ebooks/txt/txtml.py @@ -150,8 +150,8 @@ class TXTMLizer(object): text = re.sub(r'(?u)^[ \n]+', '', text) if self.opts.max_line_length: - max_length = self.opts.max_line_length - if self.opts.max_line_length < 25 and not self.opts.force_max_line_length: + max_length = int(self.opts.max_line_length) + if max_length < 25 and not self.opts.force_max_line_length: max_length = 25 short_lines = [] lines = text.splitlines()