diff --git a/src/calibre/ebooks/oeb/reader.py b/src/calibre/ebooks/oeb/reader.py index b99f5d1087..4f31aa0b3b 100644 --- a/src/calibre/ebooks/oeb/reader.py +++ b/src/calibre/ebooks/oeb/reader.py @@ -113,10 +113,10 @@ class OEBReader(object): self.logger.warn('OPF contains invalid HTML named entities') except etree.XMLSyntaxError: data = re.sub(r'(?is).+', '', data) - self.logger.warn('OPF contains invalid tours section') data = data.replace('', '') opf = etree.fromstring(data) + self.logger.warn('OPF contains invalid tours section') ns = namespace(opf.tag) if ns not in ('', OPF1_NS, OPF2_NS):