[gentoo-commits] repo/gentoo:master commit in: dev-python/feedparser/files/
commit: 2853a3cbbc30fc8a7386d00f488d8c0ebbd5ff69 Author: Michael Mair-Keimberger levelnine at> AuthorDate: Sat Nov 13 17:04:13 2021 + Commit: Conrad Kostecki gentoo org> CommitDate: Mon Nov 15 21:55:53 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2853a3cb dev-python/feedparser: remove unused patch Closes: https://github.com/gentoo/gentoo/pull/22937 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Michael Mair-Keimberger levelnine.at> Signed-off-by: Conrad Kostecki gentoo.org> .../files/feedparser-5.2.1-sgmllib.patch | 78 -- 1 file changed, 78 deletions(-) diff --git a/dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch b/dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch deleted file mode 100644 index 714480560e52.. --- a/dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 812793c07d3202d3f5bc39091aec2e7071d000c8 Mon Sep 17 00:00:00 2001 -From: Sebastian Pipping -Date: Sun, 1 Jan 2012 19:30:57 +0100 -Subject: [PATCH] Use shipped sgmllib for Python 3.x - - feedparser/feedparser.py | 19 +++ - setup.py |2 +- - 2 files changed, 4 insertions(+), 17 deletions(-) - -diff --git a/feedparser/feedparser.py b/feedparser/feedparser.py -index 8275c29..9a8a053 100644 a/feedparser/feedparser.py -+++ b/feedparser/feedparser.py -@@ -204,17 +204,9 @@ else: - try: - import sgmllib - except ImportError: --# This is probably Python 3, which doesn't include sgmllib anymore --_SGML_AVAILABLE = 0 -+import _feedparser_sgmllib as sgmllib - --# Mock sgmllib enough to allow subclassing later on --class sgmllib(object): --class SGMLParser(object): --def goahead(self, i): --pass --def parse_starttag(self, i): --pass --else: -+if True: - _SGML_AVAILABLE = 1 - - # sgmllib defines a number of module-level regular expressions that are -@@ -2520,9 +2512,6 @@ class _RelativeURIResolver(_BaseHTMLProcessor): - _BaseHTMLProcessor.unknown_starttag(self, tag, attrs) - - def _resolveRelativeURIs(htmlSource, baseURI, encoding, _type): --if not _SGML_AVAILABLE: --return htmlSource -- - p = _RelativeURIResolver(baseURI, encoding, _type) - p.feed(htmlSource) - return p.output() -@@ -2803,8 +2792,6 @@ class _HTMLSanitizer(_BaseHTMLProcessor): - - - def _sanitizeHTML(htmlSource, encoding, _type): --if not _SGML_AVAILABLE: --return htmlSource - p = _HTMLSanitizer(encoding, _type) - htmlSource =
[gentoo-commits] repo/gentoo:master commit in: dev-python/feedparser/files/, dev-python/feedparser/
commit: 60e7f4aadb392dcc56d7182a78b7715a114ef3ac Author: Arthur Zamarin gentoo org> AuthorDate: Fri Sep 17 18:10:32 2021 + Commit: Arthur Zamarin gentoo org> CommitDate: Fri Sep 17 18:10:32 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60e7f4aa dev-python/feedparser: enable py3.10 Signed-off-by: Arthur Zamarin gentoo.org> dev-python/feedparser/feedparser-6.0.8.ebuild | 8 ++-- .../feedparser/files/feedparser-6.0.8-fix-py3.10.patch| 15 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dev-python/feedparser/feedparser-6.0.8.ebuild b/dev-python/feedparser/feedparser-6.0.8.ebuild index dceae5fe0ca..4b502ad6931 100644 --- a/dev-python/feedparser/feedparser-6.0.8.ebuild +++ b/dev-python/feedparser/feedparser-6.0.8.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{8..9} pypy3 ) +PYTHON_COMPAT=( python3_{8..10} pypy3 ) inherit distutils-r1 @@ -23,6 +23,10 @@ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 sparc x86 ~amd64-li RDEPEND="dev-python/sgmllib3k[${PYTHON_USEDEP}]" +PATCHES=( + "${FILESDIR}/${P}-fix-py3.10.patch" +) + distutils_enable_tests unittest src_prepare() { @@ -34,5 +38,5 @@ src_prepare() { } python_test() { - "${EPYTHON}" tests/runtests.py || die + "${EPYTHON}" tests/runtests.py || die "Tests failed with ${EPYTHON}" } diff --git a/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch b/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch new file mode 100644 index 000..8f835f37207 --- /dev/null +++ b/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch @@ -0,0 +1,15 @@ +From: Kurt McKee +Date: Sat, 12 Jun 2021 15:32:05 -0500 +Subject: [PATCH] Fix a crash that occurs with Python 3.10.0b2 + +--- 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
[gentoo-commits] repo/gentoo:master commit in: dev-python/feedparser/files/, dev-python/feedparser/
commit: 5695f869596291ca227e11ec7b42fd888e46f9ed Author: Michał Górny gentoo org> AuthorDate: Fri Jun 12 14:35:07 2020 + Commit: Michał Górny gentoo org> CommitDate: Fri Jun 12 15:40:09 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5695f869 dev-python/feedparser: Port to py3.9 Signed-off-by: Michał Górny gentoo.org> .../feedparser/feedparser-6.0.0_beta1.ebuild | 6 +- .../files/feedparser-6.0.0_beta1-py39.patch| 89 ++ 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/dev-python/feedparser/feedparser-6.0.0_beta1.ebuild b/dev-python/feedparser/feedparser-6.0.0_beta1.ebuild index c85240293a4..1b027df2319 100644 --- a/dev-python/feedparser/feedparser-6.0.0_beta1.ebuild +++ b/dev-python/feedparser/feedparser-6.0.0_beta1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{6..8} pypy3 ) +PYTHON_COMPAT=( python3_{6..9} pypy3 ) inherit distutils-r1 @@ -24,6 +24,10 @@ RDEPEND="dev-python/sgmllib3k[${PYTHON_USEDEP}]" distutils_enable_tests unittest +PATCHES=( + "${FILESDIR}"/${P}-py39.patch +) + src_prepare() { # broken rm \ diff --git a/dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch b/dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch new file mode 100644 index 000..f9315e47809 --- /dev/null +++ b/dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch @@ -0,0 +1,89 @@ +From fa587d171aed1b44ee06af271d718ab6fa73b77a Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan +Date: Wed, 26 Feb 2020 22:06:39 +0530 +Subject: [PATCH 1/2] Use encodebytes instead of encodestring in Python 3.9. + +--- + feedparser/http.py | 5 - + feedparser/mixin.py | 5 - + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/feedparser/http.py b/feedparser/http.py +index 272faad6..53511f02 100644 +--- a/feedparser/http.py b/feedparser/http.py +@@ -73,7 +73,10 @@ class request(object): + + # Python 3.1 deprecated decodestring in favor of decodebytes. + # This can be removed after Python 2.7 support is dropped. +-_base64decode = getattr(base64, 'decodebytes', base64.decodestring) ++try: ++_base64decode = base64.decodebytes ++except AttributeError: ++_base64decode = base64.decodestring + + try: + basestring +diff --git a/feedparser/mixin.py b/feedparser/mixin.py +index 1b0dc1ae..549931f5 100644 +--- a/feedparser/mixin.py b/feedparser/mixin.py +@@ -50,7 +50,10 @@ + + # Python 2.7 only offers "decodestring()". + # This name substitution can be removed when Python 2.7 support is dropped. +-_base64decode = getattr(base64, 'decodebytes', base64.decodestring) ++try: ++_base64decode = base64.decodebytes ++except AttributeError: ++_base64decode = base64.decodestring + + + bytes_ = type(b'') + +From 7798957b66c9cee00db9a18f84c518cacf8f14aa Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan +Date: Sun, 17 May 2020 14:25:17 + +Subject: [PATCH 2/2] Use base64.decodebytes only in Python 3 + +--- + feedparser/http.py | 7 +-- + feedparser/mixin.py | 7 +-- + 2 files changed, 2 insertions(+), 12 deletions(-) + +diff --git a/feedparser/http.py b/feedparser/http.py +index 53511f02..1119cb3b 100644 +--- a/feedparser/http.py b/feedparser/http.py +@@ -71,12 +71,7 @@ class request(object): + from .datetimes import _parse_date + from .urls import convert_to_idn + +-# Python 3.1 deprecated decodestring in favor of decodebytes. +-# This can be removed after Python 2.7 support is dropped. +-try: +-_base64decode = base64.decodebytes +-except AttributeError: +-_base64decode = base64.decodestring ++_base64decode = base64.decodebytes + + try: + basestring +diff --git a/feedparser/mixin.py b/feedparser/mixin.py +index 549931f5..119fa4ca 100644 +--- a/feedparser/mixin.py b/feedparser/mixin.py +@@ -48,12 +48,7 @@ + from .urls import _urljoin, make_safe_absolute_uri, resolve_relative_uris + + +-# Python 2.7 only offers "decodestring()". +-# This name substitution can be removed when Python 2.7 support is dropped. +-try: +-_base64decode = base64.decodebytes +-except AttributeError: +-_base64decode = base64.decodestring ++_base64decode = base64.decodebytes + + + bytes_ = type(b'')