py-feedparser5: Compatibility with Python 3.9diff -r1.1 -r1.2 pkgsrc/textproc/py-feedparser5/Makefile
(nia)
@@ -1,21 +1,22 @@ | @@ -1,21 +1,22 @@ | |||
1 | # $NetBSD: Makefile,v 1.1 2020/10/13 12:16:39 schmonz Exp $ | 1 | # $NetBSD: Makefile,v 1.2 2021/08/19 19:21:00 nia Exp $ | |
2 | 2 | |||
3 | DISTNAME= feedparser-5.2.1 | 3 | DISTNAME= feedparser-5.2.1 | |
4 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | 4 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | |
5 | PKGREVISION= 1 | |||
5 | CATEGORIES= textproc python | 6 | CATEGORIES= textproc python | |
6 | MASTER_SITES= ${MASTER_SITE_PYPI:=f/feedparser/} | 7 | MASTER_SITES= ${MASTER_SITE_PYPI:=f/feedparser/} | |
7 | 8 | |||
8 | MAINTAINER= schmonz@NetBSD.org | 9 | MAINTAINER= schmonz@NetBSD.org | |
9 | HOMEPAGE= https://pypi.python.org/pypi/feedparser | 10 | HOMEPAGE= https://pypi.python.org/pypi/feedparser | |
10 | COMMENT= Parse RSS and Atom feeds in Python | 11 | COMMENT= Parse RSS and Atom feeds in Python | |
11 | LICENSE= 2-clause-bsd | 12 | LICENSE= 2-clause-bsd | |
12 | 13 | |||
13 | PREV_PKGPATH= textproc/py-feedparser | 14 | PREV_PKGPATH= textproc/py-feedparser | |
14 | 15 | |||
15 | USE_LANGUAGES= #none | 16 | USE_LANGUAGES= #none | |
16 | 17 | |||
17 | do-test: | 18 | do-test: | |
18 | cd ${WRKSRC}/feedparser && ${PYTHONBIN} feedparsertest.py | 19 | cd ${WRKSRC}/feedparser && ${PYTHONBIN} feedparsertest.py | |
19 | 20 | |||
20 | .include "../../lang/python/egg.mk" | 21 | .include "../../lang/python/egg.mk" | |
21 | .include "../../mk/bsd.pkg.mk" | 22 | .include "../../mk/bsd.pkg.mk" |
@@ -1,6 +1,7 @@ | @@ -1,6 +1,7 @@ | |||
1 | $NetBSD: distinfo,v 1.1 2020/10/13 12:16:39 schmonz Exp $ | 1 | $NetBSD: distinfo,v 1.2 2021/08/19 19:21:00 nia Exp $ | |
2 | 2 | |||
3 | SHA1 (feedparser-5.2.1.tar.gz) = 84f05bf1d1443cc55b9893e2cb5aa2b16ab55dec | 3 | SHA1 (feedparser-5.2.1.tar.gz) = 84f05bf1d1443cc55b9893e2cb5aa2b16ab55dec | |
4 | RMD160 (feedparser-5.2.1.tar.gz) = d48648b794bdd8af38e77b8337ac2241d79bca4c | 4 | RMD160 (feedparser-5.2.1.tar.gz) = d48648b794bdd8af38e77b8337ac2241d79bca4c | |
5 | SHA512 (feedparser-5.2.1.tar.gz) = 1fd0c4324e2eff8ef4b15e3793c767290bca562af4a5056fdbdfa12411095530c87a113bb1b9757e532ff63aecb399b18f1e6b753884798eb6b8d3fdf575af81 | 5 | SHA512 (feedparser-5.2.1.tar.gz) = 1fd0c4324e2eff8ef4b15e3793c767290bca562af4a5056fdbdfa12411095530c87a113bb1b9757e532ff63aecb399b18f1e6b753884798eb6b8d3fdf575af81 | |
6 | Size (feedparser-5.2.1.tar.gz) = 252956 bytes | 6 | Size (feedparser-5.2.1.tar.gz) = 252956 bytes | |
7 | SHA1 (patch-feedparser_feedparser.py) = dd96707b0a85cd0d2f40dea2e7cd14f3235a905c |
$NetBSD: patch-feedparser_feedparser.py,v 1.1 2021/08/19 19:21:00 nia Exp $
Fix compatibility with Python 3.9.
Backported from:
https://github.com/kurtmckee/feedparser/pull/206
https://bugzilla.redhat.com/show_bug.cgi?id=1807186
--- feedparser/feedparser.py.orig 2015-07-24 05:00:04.000000000 +0000
+++ feedparser/feedparser.py
@@ -90,7 +90,10 @@ except ImportError:
base64 = binascii = None
else:
# Python 3.1 deprecates decodestring in favor of decodebytes
- _base64decode = getattr(base64, 'decodebytes', base64.decodestring)
+ try:
+ _base64decode = base64.decodebytes
+ except AttributeError:
+ _base64decode = base64.decodestring
# _s2bytes: convert a UTF-8 str to bytes if the interpreter is Python 3
# _l2bytes: convert a list of ints to bytes if the interpreter is Python 3