Fix #980 (error fectching a source with more than one rss feed)

This commit is contained in:
Kovid Goyal 2008-08-31 11:15:18 -07:00
parent 964727579f
commit f839c4d9a9
2 changed files with 2 additions and 2 deletions

View File

@ -437,7 +437,7 @@ class HTMLConverter(object, LoggingInterface):
for s in props.split(';'):
l = s.split(':',1)
if len(l)==2:
key = str(l[0].strip()).lower()
key = l[0].strip().lower()
val = l[1].strip()
prop [key] = val
return prop

View File

@ -1452,7 +1452,7 @@ class _BaseHTMLProcessor(sgmllib.SGMLParser):
# thanks to Kevin Marks for this breathtaking hack to deal with (valid) high-bit attribute values in UTF-8 feeds
for key, value in attrs:
if type(value) != type(u''):
value = unicode(value, self.encoding)
value = unicode(value, self.encoding, 'replace')
uattrs.append((unicode(key, self.encoding), value))
strattrs = u''.join([u' %s="%s"' % (key, value) for key, value in uattrs]).encode(self.encoding)
if tag in self.elements_no_end_tag: