From b1b291007cb03693c35ecd43a4332973fa95a274 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 27 Jan 2010 11:34:59 -0700 Subject: [PATCH] EPUB Input: Handle empty XML files. Fixes #4705 (epub to mobi conversion fails) --- src/calibre/ebooks/oeb/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 753b1722de..18d3de1e56 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -760,6 +760,8 @@ class Manifest(object): def _parse_xml(self, data): data = xml_to_unicode(data, strip_encoding_pats=True)[0] + if not data: + return None parser = etree.XMLParser(recover=True) try: return etree.fromstring(data, parser=parser)