mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-05-30 10:35:20 -04:00
EPUB Input: Handle empty XML files. Fixes #4705 (epub to mobi conversion fails)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user