17
0

Accepting request 978244 from devel:languages:python

- Add 304_python310-crash.patch fixing crash of test test_001741
  on Python 3.10 (gh#kurtmckee/feedparser#304).
- update to version 6.0.9:
  * Fix a crash that can occur with GeoRSS feeds that lack a 
    <where> tag. (#305)

OBS-URL: https://build.opensuse.org/request/show/978244
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-feedparser?expand=0&rev=35
This commit is contained in:
2022-05-20 15:50:48 +00:00
committed by Git OBS Bridge
5 changed files with 55 additions and 8 deletions

34
304_python310-crash.patch Normal file
View File

@@ -0,0 +1,34 @@
From c55bd8ad37db89bd219783bc514d600c9523ed38 Mon Sep 17 00:00:00 2001
From: Kurt McKee <contactme@kurtmckee.org>
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('&lt;')
return i+1

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ce0410a05ab248c8c7cfca3a0ea2203968ee9ff4486067379af4827a59f9661
size 285827

3
feedparser-6.0.9.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dad42e7beaec55f99c08b2b0cf7288bc7cfd24b6f72c8ef85478bcb55648cd42
size 286366

View File

@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Fri May 20 09:28:16 UTC 2022 - Matej Cepl <mcepl@suse.com>
- 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 <benoit.monin@gmx.fr>
- update to version 6.0.9:
* Fix a crash that can occur with GeoRSS feeds that lack a
<where> tag. (#305)
-------------------------------------------------------------------
Mon Feb 7 21:02:35 UTC 2022 - Matej Cepl <mcepl@suse.com>

View File

@@ -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