Date: Tue, 6 Oct 2009 19:49:19 +0200 (CEST) From: Tobias Rehbein <tobias.rehbein@web.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/139383: [patch] port mail/rss2email fails for certain feeds Message-ID: <200910061749.n96HnJ9n002743@sushi.pseudo.local> Resent-Message-ID: <200910061750.n96Ho1YY025667@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 139383 >Category: ports >Synopsis: [patch] port mail/rss2email fails for certain feeds >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Oct 06 17:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Tobias Rehbein >Release: FreeBSD 8.0-RC1 i386 >Organization: >Environment: System: FreeBSD sushi.pseudo.local 8.0-RC1 FreeBSD 8.0-RC1 #54: Sat Oct 3 16:40:05 CEST 2009 tobi@sushi.pseudo.local:/usr/obj/usr/src/sys/SUSHI i386 >Description: rss2email fails to process certain feeds. Most notably for me it bails out for sourceforges file release feeds. >How-To-Repeat: Example feed exposing the error: http://sourceforge.net/api/file/index/project-id/143991/rss >Fix: Attached is a patch which works around the issue. I have pulled it out of: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=543710 The corresponding bug report for feedparser is: http://code.google.com/p/feedparser/issues/detail?id=96 --- mail-rss2email.diff begins here --- diff -ruN mail/rss2email.orig/Makefile mail/rss2email/Makefile --- mail/rss2email.orig/Makefile 2009-09-30 16:05:17.000000000 +0200 +++ mail/rss2email/Makefile 2009-10-06 10:48:54.000000000 +0200 @@ -7,6 +7,7 @@ PORTNAME= rss2email PORTVERSION= 2.65 +PORTREVISION= 1 CATEGORIES= mail python MASTER_SITES= http://www.chifeng.name/dist/rss2email/ diff -ruN mail/rss2email.orig/files/patch-rss2email.py mail/rss2email/files/patch-rss2email.py --- mail/rss2email.orig/files/patch-rss2email.py 1970-01-01 01:00:00.000000000 +0100 +++ mail/rss2email/files/patch-rss2email.py 2009-10-06 10:47:13.000000000 +0200 @@ -0,0 +1,30 @@ +--- ./rss2email.py.orig 2009-10-06 10:43:03.000000000 +0200 ++++ ./rss2email.py 2009-10-06 10:43:26.000000000 +0200 +@@ -348,15 +348,15 @@ + if conts: + if HTMLOK: + for c in conts: +- if contains(c.type, 'html'): return ('HTML', c.value) ++ if contains(c.get('type',''), 'html'): return ('HTML', c.value) + + if not HTMLOK: # Only need to convert to text if HTML isn't OK + for c in conts: +- if contains(c.type, 'html'): ++ if contains(c.get('type',''), 'html'): + return html2text(c.value) + + for c in conts: +- if c.type == 'text/plain': return c.value ++ if c.get('type','') == 'text/plain': return c.value + + return conts[0].value + +@@ -595,7 +595,7 @@ + + if 'title_detail' in entry and entry.title_detail: + title = entry.title_detail.value +- if contains(entry.title_detail.type, 'html'): ++ if contains(entry.title_detail.get('type',''), 'html'): + title = html2text(title) + else: + title = getContent(entry)[:70] --- mail-rss2email.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910061749.n96HnJ9n002743>