Bug 187397 - [PATCH] textproc/py-feedparser: backport fix with chardet issue
[PATCH] textproc/py-feedparser: backport fix with chardet issue
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Sofian Brabez
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-09 17:20 UTC by poyopoyo
Modified: 2014-05-22 11:20 UTC (History)
0 users

See Also:


Attachments
file.diff (1.38 KB, patch)
2014-03-09 17:20 UTC, poyopoyo
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description poyopoyo 2014-03-09 17:20:00 UTC
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
$
Comment 1 Edwin Groothuis freebsd_committer 2014-03-09 17:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sbz

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter freebsd_committer 2014-05-22 11:17:45 UTC
Author: miwi
Date: Thu May 22 10:17:41 2014
New Revision: 354821
URL: http://svnweb.freebsd.org/changeset/ports/354821
QAT: https://qat.redports.org/buildarchive/r354821/

Log:
  - Backport a fix for chardet issue which prevents mail/rss2email3 from
    working correctly on certain environment.
  
  PR:		187397
  Submitted by:	poyopoyo@puripuri.plala.or.jp
  Approved by:	maintainer timeout

Added:
  head/textproc/py-feedparser/files/patch-feedparser_feedparser.py   (contents, props changed)
Modified:
  head/textproc/py-feedparser/Makefile

Modified: head/textproc/py-feedparser/Makefile
==============================================================================
--- head/textproc/py-feedparser/Makefile	Thu May 22 10:16:15 2014	(r354820)
+++ head/textproc/py-feedparser/Makefile	Thu May 22 10:17:41 2014	(r354821)
@@ -3,7 +3,7 @@
 
 PORTNAME=	feedparser
 PORTVERSION=	5.1.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	textproc python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

Added: head/textproc/py-feedparser/files/patch-feedparser_feedparser.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/textproc/py-feedparser/files/patch-feedparser_feedparser.py	Thu May 22 10:17:41 2014	(r354821)
@@ -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'):
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Martin Wilke freebsd_committer 2014-05-22 11:17:56 UTC
State Changed
From-To: open->closed

Committed. Thanks!