From: Brett Parker Date: Mon, 11 Feb 2013 09:41:39 +0000 (+0000) Subject: Stop trying to decode image tags to utf-8 X-Git-Url: https://git.sommitrealweird.co.uk/rss2maildir.git/commitdiff_plain/0cecf7db4b4c9b9e32a161006db49d38672df8aa?ds=sidebyside;hp=82cab2ee7efbfde9b74a65ff10d0c4d1c05a0d7b Stop trying to decode image tags to utf-8 - If the title/url contains a utf-8 character and we try to decode it it will fail due to not being present in the ascii set. Feedparser has already made sure that everything is utf-8 before we get it. --- diff --git a/rss2maildir.py b/rss2maildir.py index 8a59c85..dc0427a 100755 --- a/rss2maildir.py +++ b/rss2maildir.py @@ -307,9 +307,9 @@ class HTML2Text(HTMLParser): url = u'' for attr in attrs: if attr[0] == 'alt': - alt = attr[1].decode('utf-8') + alt = attr[1] elif attr[0] == 'src': - url = attr[1].decode('utf-8') + url = attr[1] if url: if alt: if self.images.has_key(alt):