diff --git a/0001-Don-t-always-expect-base64.decodestring-to-exist.patch b/0001-Don-t-always-expect-base64.decodestring-to-exist.patch new file mode 100644 index 0000000..b79e121 --- /dev/null +++ b/0001-Don-t-always-expect-base64.decodestring-to-exist.patch @@ -0,0 +1,35 @@ +From 696d957e13d1bc5b2034dcd637bc088cc4646a53 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Fri, 15 May 2020 09:15:20 -0700 +Subject: [PATCH] Don't always expect base64.decodestring to exist + +This does the same as before, but in such a way as not to fail if +`base64.decodestring` doesn't exist at all - as is the case in +Python 3.9. + +This is a backport of #206 on top of 5.2.1. + +Signed-off-by: Adam Williamson +--- + feedparser/feedparser.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/feedparser/feedparser.py b/feedparser/feedparser.py +index 999cb0d..1548db8 100644 +--- a/feedparser/feedparser.py ++++ b/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 +-- +2.26.2 + diff --git a/python-feedparser.spec b/python-feedparser.spec index 1c0903f..a480955 100644 --- a/python-feedparser.spec +++ b/python-feedparser.spec @@ -2,7 +2,7 @@ Name: python-feedparser Version: 5.2.1 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Parse RSS and Atom feeds in Python License: BSD @@ -13,6 +13,11 @@ Source0: https://pypi.python.org/packages/source/f/%{srcname}/%{srcname}- # ImportError: No module named 'BaseHTTPServer' Patch0: feedparser-5.1.3-tests-py3.patch +# Fix for decodestring being removed in Python 3.9 +# https://github.com/kurtmckee/feedparser/pull/206 +# backported to 5.2.1 +Patch1: 0001-Don-t-always-expect-base64.decodestring-to-exist.patch + BuildArch: noarch %description @@ -100,6 +105,9 @@ popd %changelog +* Fri May 15 2020 Adam Williamson - 5.2.1-15 +- Backport PR #206 to fix with Python 3.9 (Karthikeyan Singaravelan) + * Thu Jan 30 2020 Fedora Release Engineering - 5.2.1-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild