From 50a13466111814cdafa7cc566f880dfc065b9b29 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 Jun 2009 09:31:47 -0700 Subject: [PATCH] Fix #2672 (Error downloading built-in news recipe for El Mundo with 0.6b8) --- src/calibre/ebooks/oeb/base.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 98f1be1068..e9f82715cb 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -785,10 +785,12 @@ class Manifest(object): data = first_pass(data) # Force into the XHTML namespace if barename(data.tag) != 'html': - data = first_pass(''+data+'') - if barename(data.tag) != 'html': - raise NotHTML( - 'File %r does not appear to be (X)HTML' % self.href) + self.log.warn('File %r does not appear to be (X)HTML'%self.href) + nroot = etree.fromstring('') + for child in list(data): + child.getparent.remove(child) + nroot.append(child) + data = nroot elif not namespace(data.tag): data.attrib['xmlns'] = XHTML_NS data = etree.tostring(data, encoding=unicode)