Bug#734327: rss2email TypeError: sequence item 1: expected string or Unicode, NoneType found
Hi Jeroen, Sorry for the delay. As Trevor said, the development is more active on the 3.x branch (still in experimental). I encourage you to try it independently of this problem! That being said, it looks more like a feedparser bug, though it can also be fixed in rss2email (the tag handling code is the same in 3.x). To be sure, can you attach a copy of the feed when it fails? I'm sure it will help other programs that use feedparser. Thanks! -- Etienne Millon -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#734327: rss2email TypeError: sequence item 1: expected string or Unicode, NoneType found
Package: rss2email Version: 1:2.71-2 Tags: patch Ola Lindsey DebianBuggers, I sometimes have a feed which generates: - === rss2email encountered a problem with this feed === === See the rss2email FAQ at http://www.allthingsrss.com/rss2email/ for assistance === === If this occurs repeatedly, send this to lind...@allthingsrss.com === E: could not parse http://soup.nibbler.tv/rss Traceback (most recent call last): File /usr/share/rss2email/rss2email.py, line 711, in run tagline = ,.join(taglist) TypeError: sequence item 1: expected string or Unicode, NoneType found rss2email 2.71 feedparser 5.1.3 html2text 3.200.3 Python 2.7.6 (default, Dec 30 2013, 14:37:40) [GCC 4.8.2] === END HERE === - I don't know which exact line in the source RSS causes it, but it happens from time to time; likely some parse going wrong. Inserting at line 710 a 'print taglist' results in: [u'image', None] Hence the attached simple patch filters out the None and voila things keep on working and I get my daily dose of silly pictures again thanks to nibbler ;) Greets, Jeroen --- rss2email.py2014-01-06 00:35:13.652294000 +0100 +++ /usr/share/rss2email/rss2email.py 2014-01-06 00:34:10.056294000 +0100 @@ -707,7 +707,7 @@ for tag in tags: taglist.append(tag['term']) if taglist: -tagline = ,.join(taglist) +tagline = ,.join(filter(None, taglist)) extraheaders = {'Date': datehdr, 'User-Agent': useragenthdr, 'X-RSS-Feed': f.url, 'X-RSS-ID': id, 'X-RSS-URL': link, 'X-RSS-TAGS' : tagline} if BONUS_HEADER != '':
Bug#734327: rss2email TypeError: sequence item 1: expected string or Unicode, NoneType found
Jeroen, On Mon, Jan 06, 2014 at 12:43:53AM +0100, Jeroen Massar wrote: Package: rss2email Version: 1:2.71-2 I've picked up maintenance for rss2email [1], and started the 3.x series which is the basis of new Debian packages [2]. You might want to give that a spin and see if you can reproduce your error with the new code. Cheers, Trevor [1]: https://github.com/wking/rss2email [2]: http://packages.debian.org/experimental/rss2email -- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy signature.asc Description: OpenPGP digital signature