Fix #2672 (Error downloading built-in news recipe for El Mundo with 0.6b8)

This commit is contained in:
Kovid Goyal 2009-06-20 09:31:47 -07:00
parent 6459a6c256
commit 50a1346611

View File

@ -785,10 +785,12 @@ class Manifest(object):
data = first_pass(data)
# Force into the XHTML namespace
if barename(data.tag) != 'html':
data = first_pass('<html>'+data+'</html>')
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('<html></html>')
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)