public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/s3cmd/files/, net-misc/s3cmd/
@ 2021-05-10 17:33 Richard Freeman
  0 siblings, 0 replies; only message in thread
From: Richard Freeman @ 2021-05-10 17:33 UTC (permalink / raw
  To: gentoo-commits

commit:     c74de5f9e7912ccf9667f9c363059e128b5d3e62
Author:     Richard Freeman <rich0 <AT> gentoo <DOT> org>
AuthorDate: Mon May 10 17:32:54 2021 +0000
Commit:     Richard Freeman <rich0 <AT> gentoo <DOT> org>
CommitDate: Mon May 10 17:32:54 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c74de5f9

net-misc/s3cmd: fix python 3.9 compat issue

Closes: https://bugs.gentoo.org/789102
Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Richard Freeman <rich0 <AT> gentoo.org>

 ...d-2.1.0-fix-compatibility-with-Python-3.9.patch | 57 ++++++++++++++++++++++
 net-misc/s3cmd/s3cmd-2.1.0-r1.ebuild               | 25 ++++++++++
 2 files changed, 82 insertions(+)

diff --git a/net-misc/s3cmd/files/s3cmd-2.1.0-fix-compatibility-with-Python-3.9.patch b/net-misc/s3cmd/files/s3cmd-2.1.0-fix-compatibility-with-Python-3.9.patch
new file mode 100644
index 00000000000..92d90c6df9b
--- /dev/null
+++ b/net-misc/s3cmd/files/s3cmd-2.1.0-fix-compatibility-with-Python-3.9.patch
@@ -0,0 +1,57 @@
+From 4806955e05011c3d981e91c12a95d84ab3aa65d4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Budai?= <obudai@redhat.com>
+Date: Fri, 2 Oct 2020 14:24:09 +0200
+Subject: [PATCH] fix compatibility with Python 3.9
+
+getchildren() method was removed from the ElementTree and Element classes in
+Python 3.9. See the release notes:
+
+https://docs.python.org/3.9/whatsnew/3.9.html#removed
+---
+ S3/Exceptions.py | 2 +-
+ S3/Utils.py      | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/S3/Exceptions.py b/S3/Exceptions.py
+index d12c5c5..2710d82 100644
+--- a/S3/Exceptions.py
++++ b/S3/Exceptions.py
+@@ -126,7 +126,7 @@ class S3Error (S3Exception):
+         if not error_node.tag == "Error":
+             error_node = tree.find(".//Error")
+         if error_node is not None:
+-            for child in error_node.getchildren():
++            for child in error_node:
+                 if child.text != "":
+                     debug("ErrorXML: " + child.tag + ": " + repr(child.text))
+                     info[child.tag] = child.text
+diff --git a/S3/Utils.py b/S3/Utils.py
+index b9f4fd5..1f66f6c 100644
+--- a/S3/Utils.py
++++ b/S3/Utils.py
+@@ -64,9 +64,9 @@ def parseNodes(nodes):
+     retval = []
+     for node in nodes:
+         retval_item = {}
+-        for child in node.getchildren():
++        for child in node:
+             name = decode_from_s3(child.tag)
+-            if child.getchildren():
++            if len(child):
+                 retval_item[name] = parseNodes([child])
+             else:
+                 found_text = node.findtext(".//%s" % child.tag)
+@@ -122,8 +122,8 @@ __all__.append("getListFromXml")
+ 
+ def getDictFromTree(tree):
+     ret_dict = {}
+-    for child in tree.getchildren():
+-        if child.getchildren():
++    for child in tree:
++        if len(child):
+             ## Complex-type child. Recurse
+             content = getDictFromTree(child)
+         else:
+-- 
+2.26.3
+

diff --git a/net-misc/s3cmd/s3cmd-2.1.0-r1.ebuild b/net-misc/s3cmd/s3cmd-2.1.0-r1.ebuild
new file mode 100644
index 00000000000..8fd4a4deed4
--- /dev/null
+++ b/net-misc/s3cmd/s3cmd-2.1.0-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_7 python3_8 python3_9 )
+PYTHON_REQ_USE="xml"
+
+inherit distutils-r1
+
+DESCRIPTION="Command line client for Amazon S3"
+HOMEPAGE="https://s3tools.org/s3cmd"
+SRC_URI="mirror://sourceforge/s3tools/${P/_/-}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86 ~amd64-linux ~x64-macos"
+
+RDEPEND="
+	dev-python/python-dateutil[${PYTHON_USEDEP}]
+	dev-python/python-magic[${PYTHON_USEDEP}]"
+
+S="${WORKDIR}/${P/_/-}"
+
+PATCHES=( "${FILESDIR}/${P}-fix-compatibility-with-Python-3.9.patch" )


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-10 17:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-10 17:33 [gentoo-commits] repo/gentoo:master commit in: net-misc/s3cmd/files/, net-misc/s3cmd/ Richard Freeman

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