This commit is contained in:
Kovid Goyal 2019-03-25 11:36:02 +05:30
parent ba59ac679d
commit e178f179e1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -123,9 +123,9 @@ class OEBReader(object):
opf = etree.fromstring(data) opf = etree.fromstring(data)
self.logger.warn('OPF contains invalid tours section') self.logger.warn('OPF contains invalid tours section')
except etree.XMLSyntaxError: except etree.XMLSyntaxError:
self.logger.warn('OPF contains invalid markup, trying to parse it anyway')
from calibre.ebooks.oeb.parse_utils import RECOVER_PARSER from calibre.ebooks.oeb.parse_utils import RECOVER_PARSER
opf = etree.fromstring(data, parser=RECOVER_PARSER) opf = etree.fromstring(data, parser=RECOVER_PARSER)
self.logger.warn('OPF contains invalid markup, trying to parse it anyway')
ns = namespace(opf.tag) ns = namespace(opf.tag)
if ns not in ('', OPF1_NS, OPF2_NS): if ns not in ('', OPF1_NS, OPF2_NS):