url = u''
for attr in attrs:
if attr[0] == 'alt':
- alt = attr[1].decode('utf-8')
+ if isinstance(attr[1], str):
+ alt = u'%s' %(attr[1].decode("utf-8"))
+ else:
+ alt = attr[1]
elif attr[0] == 'src':
- url = attr[1].decode('utf-8')
+ if isinstance(attr[1], str):
+ url = u'%s' %(attr[1].decode("utf-8"))
+ else:
+ url = attr[1]
if url:
if alt:
if self.images.has_key(alt):
]) + "@" + socket.gethostname() + ">"
msg.add_header("Message-ID", messageid)
msg.set_unixfrom("\"%s\" <rss2maildir@localhost>" %(url))
- msg.add_header("From", "\"%s\" <rss2maildir@localhost>" %(author))
- msg.add_header("To", "\"%s\" <rss2maildir@localhost>" %(url))
+ msg.add_header("From", "\"%s\" <rss2maildir@localhost>" %(author.encode("utf-8")))
+ msg.add_header("To", "\"%s\" <rss2maildir@localhost>" %(url.encode("utf-8")))
if prevmessageid:
msg.add_header("References", prevmessageid)
createddate = datetime.datetime.now() \