From 3b9d4a27a589c76295d4673b98c1647d6be81daa104f01d3b527635c854b7b09 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 29 Apr 2021 17:58:15 +0000 Subject: [PATCH 1/2] Accepting request 889334 from home:apersaud:branches:devel:languages:python - specfile: * add patch for 3.9 python version (change of return status to None) This should fix servermail:rss2email OBS-URL: https://build.opensuse.org/request/show/889334 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-feedparser?expand=0&rev=48 --- numerical_return_status.patch | 11 +++++++++++ python-feedparser.changes | 6 ++++++ python-feedparser.spec | 4 +++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 numerical_return_status.patch diff --git a/numerical_return_status.patch b/numerical_return_status.patch new file mode 100644 index 0000000..4d9b1aa --- /dev/null +++ b/numerical_return_status.patch @@ -0,0 +1,11 @@ +--- feedparser/http.py_old 2021-04-29 07:29:56.683654189 -0700 ++++ feedparser/http.py 2021-04-29 07:34:48.830331055 -0700 +@@ -203,7 +203,7 @@ + result['href'] = f.url.decode('utf-8', 'ignore') + else: + result['href'] = f.url +- result['status'] = getattr(f, 'status', 200) ++ result['status'] = getattr(f, 'status', None) or 200 + + # Stop processing if the server sent HTTP 304 Not Modified. + if getattr(f, 'code', 0) == 304: diff --git a/python-feedparser.changes b/python-feedparser.changes index 43f01f8..86882eb 100644 --- a/python-feedparser.changes +++ b/python-feedparser.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 29 14:39:29 UTC 2021 - Arun Persaud + +- specfile: + * add patch for 3.9 python version (change of return status to None) + ------------------------------------------------------------------- Sun Oct 25 17:59:36 UTC 2020 - Benoît Monin diff --git a/python-feedparser.spec b/python-feedparser.spec index 446b0d0..e8537b9 100644 --- a/python-feedparser.spec +++ b/python-feedparser.spec @@ -1,7 +1,7 @@ # # spec file for package python-feedparser # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,7 @@ License: BSD-2-Clause Group: Development/Libraries/Python URL: https://github.com/kurtmckee/feedparser Source: https://files.pythonhosted.org/packages/source/f/feedparser/feedparser-%{version}.tar.gz +Patch0: numerical_return_status.patch BuildRequires: %{python_module chardet} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sgmllib3k} @@ -44,6 +45,7 @@ A universal feed parser module for Python that handles RSS 0.9x, RSS 1.0, RSS %prep %setup -q -n feedparser-%{version} +%patch0 %build %python_build From 544a693bce0d3b90d2796e661b69953c007515967faa79c3640b3de6495135b8 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 30 Apr 2021 11:03:53 +0000 Subject: [PATCH 2/2] Add metadata, cleanup the patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-feedparser?expand=0&rev=49 --- numerical_return_status.patch | 10 +++++++--- python-feedparser.changes | 4 ++-- python-feedparser.spec | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/numerical_return_status.patch b/numerical_return_status.patch index 4d9b1aa..c4c0055 100644 --- a/numerical_return_status.patch +++ b/numerical_return_status.patch @@ -1,6 +1,10 @@ ---- feedparser/http.py_old 2021-04-29 07:29:56.683654189 -0700 -+++ feedparser/http.py 2021-04-29 07:34:48.830331055 -0700 -@@ -203,7 +203,7 @@ +--- + feedparser/http.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/feedparser/http.py ++++ b/feedparser/http.py +@@ -203,7 +203,7 @@ def get(url, etag=None, modified=None, a result['href'] = f.url.decode('utf-8', 'ignore') else: result['href'] = f.url diff --git a/python-feedparser.changes b/python-feedparser.changes index 86882eb..27c4875 100644 --- a/python-feedparser.changes +++ b/python-feedparser.changes @@ -1,8 +1,8 @@ ------------------------------------------------------------------- Thu Apr 29 14:39:29 UTC 2021 - Arun Persaud -- specfile: - * add patch for 3.9 python version (change of return status to None) +- add numerical_return_status.patch for 3.9 python version + (change of return status to None) ------------------------------------------------------------------- Sun Oct 25 17:59:36 UTC 2020 - Benoît Monin diff --git a/python-feedparser.spec b/python-feedparser.spec index e8537b9..8640f1b 100644 --- a/python-feedparser.spec +++ b/python-feedparser.spec @@ -26,6 +26,8 @@ License: BSD-2-Clause Group: Development/Libraries/Python URL: https://github.com/kurtmckee/feedparser Source: https://files.pythonhosted.org/packages/source/f/feedparser/feedparser-%{version}.tar.gz +# PATCH-FIX-UPSTREAM numerical_return_status.patch gh#kurtmckee/feedparser#272/files mcepl@suse.com +# Maintain numeric result status code in Python>=3.9 Patch0: numerical_return_status.patch BuildRequires: %{python_module chardet} BuildRequires: %{python_module setuptools} @@ -44,8 +46,7 @@ A universal feed parser module for Python that handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, Atom 1.0 feeds. %prep -%setup -q -n feedparser-%{version} -%patch0 +%autosetup -p1 -n feedparser-%{version} %build %python_build