From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Mar 9 17:20:01 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36756404 for ; Sun, 9 Mar 2014 17:20:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16216F9B for ; Sun, 9 Mar 2014 17:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s29HK0Zv087779 for ; Sun, 9 Mar 2014 17:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s29HK0dh087778; Sun, 9 Mar 2014 17:20:00 GMT (envelope-from gnats) Resent-Date: Sun, 9 Mar 2014 17:20:00 GMT Resent-Message-Id: <201403091720.s29HK0dh087778@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, poyopoyo@puripuri.plala.or.jp Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19A2FE63 for ; Sun, 9 Mar 2014 17:12:59 +0000 (UTC) Received: from msa01b.plala.or.jp (msa01.plala.or.jp [IPv6:2400:7800:0:5010::1]) by mx1.freebsd.org (Postfix) with ESMTP id A4A7CF58 for ; Sun, 9 Mar 2014 17:12:58 +0000 (UTC) Received: from i58-95-111-97.s02.a026.ap.plala.or.jp ([58.95.111.97]) by msa01b.plala.or.jp with ESMTP id <20140309171250.YCDM4134.msa01b.plala.or.jp@i58-95-111-97.s02.a026.ap.plala.or.jp> for ; Mon, 10 Mar 2014 02:12:50 +0900 Message-Id: <86zjkzuwia.wl%poyopoyo@puripuri.plala.or.jp> Date: Mon, 10 Mar 2014 02:12:13 +0900 From: poyopoyo@puripuri.plala.or.jp To: FreeBSD-gnats-submit@freebsd.org Subject: ports/187397: [PATCH] textproc/py-feedparser: backport fix with chardet issue X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 17:20:01 -0000 >Number: 187397 >Category: ports >Synopsis: [PATCH] textproc/py-feedparser: backport fix with chardet issue >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: Sun Mar 09 17:20:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: SATO Kuro >Release: FreeBSD 10.0-CURRENT amd64 >Organization: personal >Environment: >Description: Backport a fix for chardet issue which prevents mail/rss2email3 from working correctly on certain environment. As this fix is from feedparser development tree, it will be incorporated in the next release. http://code.google.com/p/feedparser/source/detail?r=20a32910f4a5 | Commit Date: Dec 17, 2012 | Log message | Fix chardet support in Python 3 | Fixes issue 384 . | Thanks to Google user Arfrever.TFA for reporting this! >How-To-Repeat: $ r2e run error while running time limited function: decoding str is not supported cause: decoding str is not supported error while running time limited function: decoding str is not supported cause: decoding str is not supported ... error while running time limited function: decoding str is not supported cause: decoding str is not supported $ >Fix: Index: Makefile =================================================================== --- Makefile (revision 347660) +++ Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= feedparser PORTVERSION= 5.1.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= textproc python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} Index: files/patch-feedparser_feedparser.py =================================================================== --- files/patch-feedparser_feedparser.py (revision 0) +++ files/patch-feedparser_feedparser.py (working copy) @@ -0,0 +1,15 @@ +--- feedparser/feedparser.py.orig 2014-03-10 01:45:12.000000000 +0900 ++++ feedparser/feedparser.py 2014-03-10 01:45:53.000000000 +0900 +@@ -3766,7 +3766,11 @@ + chardet_encoding = None + tried_encodings = [] + if chardet: +- chardet_encoding = unicode(chardet.detect(data)['encoding'] or '', 'ascii', 'ignore') ++ chardet_encoding = chardet.detect(data)['encoding'] ++ if not chardet_encoding: ++ chardet_encoding = '' ++ if not isinstance(chardet_encoding, str): ++ chardet_encoding = str(chardet_encoding, 'ascii', 'ignore') + # try: HTTP encoding, declared XML encoding, encoding sniffed from BOM + for proposed_encoding in (rfc3023_encoding, xml_encoding, bom_encoding, + chardet_encoding, u'utf-8', u'windows-1252', u'iso-8859-2'): >Release-Note: >Audit-Trail: >Unformatted: