From ef8f3e006ca70ce74cfd20f68ce79e0b5cc1c8a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 5 Jun 2014 09:23:54 +0530 Subject: [PATCH] Check Book: Fix combination of mismatching font family names and a font-family declaration with an invalid value (such as a dimension) causing auto fixing of errors to fail. Fixes #1325070 [Private bug](https://bugs.launchpad.net/calibre/+bug/1325070) --- src/calibre/ebooks/oeb/polish/check/fonts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/check/fonts.py b/src/calibre/ebooks/oeb/polish/check/fonts.py index 5209564661..76f3b28510 100644 --- a/src/calibre/ebooks/oeb/polish/check/fonts.py +++ b/src/calibre/ebooks/oeb/polish/check/fonts.py @@ -30,7 +30,7 @@ def fix_declaration(style, css_name, font_name): if ff is not None: for i in xrange(ff.length): val = ff.item(i) - if val.value and val.value.lower() == css_name.lower(): + if hasattr(val.value, 'lower') and val.value.lower() == css_name.lower(): val.value = font_name # If val.type == 'IDENT' cssutils will not serialize the font # name properly (it will not enclose it in quotes). There we