public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/feedparser/files/, dev-python/feedparser/
@ 2020-06-12 15:40 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-06-12 15:40 UTC (permalink / raw
  To: gentoo-commits

commit:     5695f869596291ca227e11ec7b42fd888e46f9ed
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 12 14:35:07 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun 12 15:40:09 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5695f869

dev-python/feedparser: Port to py3.9

Signed-off-by: Michał Górny <mgorny <AT> 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 00000000000..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 <tir.karthi@gmail.com>
+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 <tir.karthi@gmail.com>
+Date: Sun, 17 May 2020 14:25:17 +0000
+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'')


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/feedparser/files/, dev-python/feedparser/
@ 2021-09-17 18:11 Arthur Zamarin
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2021-09-17 18:11 UTC (permalink / raw
  To: gentoo-commits

commit:     60e7f4aadb392dcc56d7182a78b7715a114ef3ac
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 17 18:10:32 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 17 18:10:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60e7f4aa

dev-python/feedparser: enable py3.10

Signed-off-by: Arthur Zamarin <arthurzam <AT> 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 00000000000..8f835f37207
--- /dev/null
+++ b/dev-python/feedparser/files/feedparser-6.0.8-fix-py3.10.patch
@@ -0,0 +1,15 @@
+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
+
+--- 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-17 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-17 18:11 [gentoo-commits] repo/gentoo:master commit in: dev-python/feedparser/files/, dev-python/feedparser/ Arthur Zamarin
  -- strict thread matches above, loose matches on Subject: below --
2020-06-12 15:40 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox