X-Git-Url: https://git.sommitrealweird.co.uk/rss2maildir.git/blobdiff_plain/82cab2ee7efbfde9b74a65ff10d0c4d1c05a0d7b..aa4dd6a06ba1dd47704ac7dd6bcaa062673162d1:/rss2maildir.py?ds=sidebyside diff --git a/rss2maildir.py b/rss2maildir.py index 8a59c85..a9abe4d 100755 --- a/rss2maildir.py +++ b/rss2maildir.py @@ -307,9 +307,15 @@ class HTML2Text(HTMLParser): 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):