From 0885b4509743cbb28b66c359f9d275ef9499db6f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 25 Jun 2021 23:20:58 +0530 Subject: [PATCH] Fix #1933684 [Error converting ePUB to MOBI](https://bugs.launchpad.net/calibre/+bug/1933684) --- src/calibre/ebooks/mobi/mobiml.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/mobiml.py b/src/calibre/ebooks/mobi/mobiml.py index 53eefbc61f..d750a4907d 100644 --- a/src/calibre/ebooks/mobi/mobiml.py +++ b/src/calibre/ebooks/mobi/mobiml.py @@ -373,7 +373,10 @@ class MobiMLizer(object): bstate.para = None istate.halign = style['text-align'] rawti = style._get('text-indent') - istate.indent = style['text-indent'] + try: + istate.indent = style['text-indent'] + except Exception: + istate.indent = 0 if hasattr(rawti, 'strip') and '%' in rawti: # We have a percentage text indent, these can come out looking # too large if the user chooses a wide output profile like