View | Details | Raw Unified | Return to bug 187397
Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	feedparser
4
PORTNAME=	feedparser
5
PORTVERSION=	5.1.3
5
PORTVERSION=	5.1.3
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	textproc python
7
CATEGORIES=	textproc python
8
MASTER_SITES=	CHEESESHOP
8
MASTER_SITES=	CHEESESHOP
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
(-)files/patch-feedparser_feedparser.py (+15 lines)
Line 0 Link Here
1
--- feedparser/feedparser.py.orig	2014-03-10 01:45:12.000000000 +0900
2
+++ feedparser/feedparser.py	2014-03-10 01:45:53.000000000 +0900
3
@@ -3766,7 +3766,11 @@
4
     chardet_encoding = None
5
     tried_encodings = []
6
     if chardet:
7
-        chardet_encoding = unicode(chardet.detect(data)['encoding'] or '', 'ascii', 'ignore')
8
+        chardet_encoding = chardet.detect(data)['encoding']
9
+        if not chardet_encoding:
10
+            chardet_encoding = ''
11
+        if not isinstance(chardet_encoding, str):
12
+            chardet_encoding = str(chardet_encoding, 'ascii', 'ignore')
13
     # try: HTTP encoding, declared XML encoding, encoding sniffed from BOM
14
     for proposed_encoding in (rfc3023_encoding, xml_encoding, bom_encoding,
15
                               chardet_encoding, u'utf-8', u'windows-1252', u'iso-8859-2'):

Return to bug 187397