diff --git a/304_python310-crash.patch b/304_python310-crash.patch new file mode 100644 index 0000000..6ec755a --- /dev/null +++ b/304_python310-crash.patch @@ -0,0 +1,34 @@ +From c55bd8ad37db89bd219783bc514d600c9523ed38 Mon Sep 17 00:00:00 2001 +From: Kurt McKee +Date: Sat, 12 Jun 2021 15:32:05 -0500 +Subject: [PATCH] Fix a crash that occurs with Python 3.10.0b2 + +--- + changelog.d/20210612_152233_kurtmckee_python3_10.rst | 4 ++++ + feedparser/html.py | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + create mode 100644 changelog.d/20210612_152233_kurtmckee_python3_10.rst + +diff --git a/changelog.d/20210612_152233_kurtmckee_python3_10.rst b/changelog.d/20210612_152233_kurtmckee_python3_10.rst +new file mode 100644 +index 00000000..3795cdc0 +--- /dev/null ++++ b/changelog.d/20210612_152233_kurtmckee_python3_10.rst +@@ -0,0 +1,4 @@ ++Fixed ++----- ++ ++* Fix a crash that occurs with Python 3.10.0b2. +diff --git a/feedparser/html.py b/feedparser/html.py +index be913311..f78270a3 100644 +--- a/feedparser/html.py ++++ b/feedparser/html.py +@@ -337,7 +337,7 @@ def parse_declaration(self, i): + + try: + return sgmllib.SGMLParser.parse_declaration(self, i) +- except sgmllib.SGMLParseError: ++ except (AssertionError, sgmllib.SGMLParseError): + # Escape the doctype declaration and continue parsing. + self.handle_data('<') + return i+1 diff --git a/feedparser-6.0.8.tar.gz b/feedparser-6.0.8.tar.gz deleted file mode 100644 index 2230cf8..0000000 --- a/feedparser-6.0.8.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5ce0410a05ab248c8c7cfca3a0ea2203968ee9ff4486067379af4827a59f9661 -size 285827 diff --git a/feedparser-6.0.9.tar.gz b/feedparser-6.0.9.tar.gz new file mode 100644 index 0000000..e79774e --- /dev/null +++ b/feedparser-6.0.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dad42e7beaec55f99c08b2b0cf7288bc7cfd24b6f72c8ef85478bcb55648cd42 +size 286366 diff --git a/python-feedparser.changes b/python-feedparser.changes index c916a18..5e291bd 100644 --- a/python-feedparser.changes +++ b/python-feedparser.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri May 20 09:28:16 UTC 2022 - Matej Cepl + +- Add 304_python310-crash.patch fixing crash of test test_001741 + on Python 3.10 (gh#kurtmckee/feedparser#304). + +------------------------------------------------------------------- +Thu May 19 19:30:30 UTC 2022 - BenoƮt Monin + +- update to version 6.0.9: + * Fix a crash that can occur with GeoRSS feeds that lack a + tag. (#305) + ------------------------------------------------------------------- Mon Feb 7 21:02:35 UTC 2022 - Matej Cepl diff --git a/python-feedparser.spec b/python-feedparser.spec index 42f1342..903cd6f 100644 --- a/python-feedparser.spec +++ b/python-feedparser.spec @@ -19,22 +19,25 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-feedparser -Version: 6.0.8 +Version: 6.0.9 Release: 0 Summary: Universal Feed Parser Module for Python 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 304_python310-crash.patch gh#kurtmckee/feedparser#304 mcepl@suse.com +# Fix crash on Python 3.10 +Patch0: 304_python310-crash.patch BuildRequires: %{python_module chardet} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sgmllib3k} BuildRequires: %{python_module xml} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-sgmllib3k Requires: python-xml Recommends: python-chardet -Requires: python-sgmllib3k BuildArch: noarch %python_subpackages @@ -45,9 +48,6 @@ A universal feed parser module for Python that handles RSS 0.9x, RSS 1.0, RSS %prep %autosetup -p1 -n feedparser-%{version} -# Remove Python 3.10 non-compatible tests -rm -v tests/wellformed/sanitize/xml_declaration_unexpected_character.xml - # Make tests more verbose sed -i -e 's/verbosity=1/verbosity=2/' tests/runtests.py