Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] s3cmd: backport Python 3.9 compatibility fix
@ 2020-11-13  8:11 Logarithmus
  2020-11-13 12:57 ` ericonr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Logarithmus @ 2020-11-13  8:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

There is a new pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages s3cmd
https://github.com/void-linux/void-packages/pull/26347

s3cmd: backport Python 3.9 compatibility fix
https://github.com/s3tools/s3cmd/issues/1146 is fixed in `master` by https://github.com/s3tools/s3cmd/pull/1137. This PR adds corresponding patch.

A patch file from https://github.com/void-linux/void-packages/pull/26347.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-s3cmd-26347.patch --]
[-- Type: text/x-diff, Size: 2828 bytes --]

From 7f7e28134d33c714d34e0aba813ae9cbb0c357bf Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Fri, 13 Nov 2020 11:08:47 +0300
Subject: [PATCH] s3cmd: backport Python 3.9 compatibility fix

---
 .../patches/python-3.9-compatibility.patch    | 36 +++++++++++++++++++
 srcpkgs/s3cmd/template                        |  4 +--
 2 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/s3cmd/patches/python-3.9-compatibility.patch

diff --git a/srcpkgs/s3cmd/patches/python-3.9-compatibility.patch b/srcpkgs/s3cmd/patches/python-3.9-compatibility.patch
new file mode 100644
index 00000000000..292d979aa29
--- /dev/null
+++ b/srcpkgs/s3cmd/patches/python-3.9-compatibility.patch
@@ -0,0 +1,36 @@
+--- S3/Exceptions.py
++++ 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
+--- S3/Utils.py
++++ 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 list(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 list(child):
+             ## Complex-type child. Recurse
+             content = getDictFromTree(child)
+         else:
diff --git a/srcpkgs/s3cmd/template b/srcpkgs/s3cmd/template
index 4ec5cf053a8..40cd669dc97 100644
--- a/srcpkgs/s3cmd/template
+++ b/srcpkgs/s3cmd/template
@@ -1,14 +1,14 @@
 # Template file for 's3cmd'
 pkgname=s3cmd
 version=2.1.0
-revision=2
+revision=3
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-dateutil"
 short_desc="Command line tool for Amazon S3"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-or-later"
-#changelog="https://github.com/s3tools/s3cmd/raw/master/NEWS"
+changelog="https://github.com/s3tools/s3cmd/raw/master/NEWS"
 homepage="http://s3tools.org/s3cmd"
 distfiles="https://github.com/s3tools/${pkgname}/archive/v${version}.tar.gz"
 checksum=2293f775fde77201bf8e489f20516fd594168c77897168f129e5c1a2b33b7e37

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

* Re: s3cmd: backport Python 3.9 compatibility fix
  2020-11-13  8:11 [PR PATCH] s3cmd: backport Python 3.9 compatibility fix Logarithmus
@ 2020-11-13 12:57 ` ericonr
  2020-11-13 16:20 ` [PR PATCH] [Updated] " Logarithmus
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2020-11-13 12:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26347#issuecomment-726750118

Comment:
Please update the patch to the final version that was merged (can be seen in https://github.com/s3tools/s3cmd/pull/1137/files )

Also, put some information in the top of the patch regarding it 1) coming from upstream; 2) should be dropped for next release.

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

* Re: [PR PATCH] [Updated] s3cmd: backport Python 3.9 compatibility fix
  2020-11-13  8:11 [PR PATCH] s3cmd: backport Python 3.9 compatibility fix Logarithmus
  2020-11-13 12:57 ` ericonr
@ 2020-11-13 16:20 ` Logarithmus
  2020-11-13 16:21 ` Logarithmus
  2020-11-14  2:04 ` [PR PATCH] [Merged]: " ericonr
  3 siblings, 0 replies; 5+ messages in thread
From: Logarithmus @ 2020-11-13 16:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

There is an updated pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages s3cmd
https://github.com/void-linux/void-packages/pull/26347

s3cmd: backport Python 3.9 compatibility fix
https://github.com/s3tools/s3cmd/issues/1146 is fixed in `master` by https://github.com/s3tools/s3cmd/pull/1137. This PR adds corresponding patch.

A patch file from https://github.com/void-linux/void-packages/pull/26347.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-s3cmd-26347.patch --]
[-- Type: text/x-diff, Size: 3480 bytes --]

From 56455a5d77cebb38ab54765bf46bc49c11ae6e9c Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Fri, 13 Nov 2020 11:08:47 +0300
Subject: [PATCH] s3cmd: backport Python 3.9 compatibility fix

---
 .../patches/python-3.9-compatibility.patch    | 54 +++++++++++++++++++
 srcpkgs/s3cmd/template                        |  4 +-
 2 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/s3cmd/patches/python-3.9-compatibility.patch

diff --git a/srcpkgs/s3cmd/patches/python-3.9-compatibility.patch b/srcpkgs/s3cmd/patches/python-3.9-compatibility.patch
new file mode 100644
index 00000000000..fe7f0fb904f
--- /dev/null
+++ b/srcpkgs/s3cmd/patches/python-3.9-compatibility.patch
@@ -0,0 +1,54 @@
+# This patch has been already merged into `master`
+# and should be dropped after next release.
+# See https://github.com/s3tools/s3cmd/pull/1137
+
+From 328ced84fe688db5ef0385f5c763cd948087d81f 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(-)
+
+--- S3/Exceptions.py
++++ S3/Exceptions.py
+@@ -127,7 +127,7 @@ def parse_error_xml(tree):
+         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
+--- S3/Utils.py
++++ S3/Utils.py
+@@ -65,9 +65,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)
+@@ -124,8 +124,8 @@ def getListFromXml(xml, node):
+ 
+ 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:
diff --git a/srcpkgs/s3cmd/template b/srcpkgs/s3cmd/template
index 4ec5cf053a8..40cd669dc97 100644
--- a/srcpkgs/s3cmd/template
+++ b/srcpkgs/s3cmd/template
@@ -1,14 +1,14 @@
 # Template file for 's3cmd'
 pkgname=s3cmd
 version=2.1.0
-revision=2
+revision=3
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-dateutil"
 short_desc="Command line tool for Amazon S3"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-or-later"
-#changelog="https://github.com/s3tools/s3cmd/raw/master/NEWS"
+changelog="https://github.com/s3tools/s3cmd/raw/master/NEWS"
 homepage="http://s3tools.org/s3cmd"
 distfiles="https://github.com/s3tools/${pkgname}/archive/v${version}.tar.gz"
 checksum=2293f775fde77201bf8e489f20516fd594168c77897168f129e5c1a2b33b7e37

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

* Re: s3cmd: backport Python 3.9 compatibility fix
  2020-11-13  8:11 [PR PATCH] s3cmd: backport Python 3.9 compatibility fix Logarithmus
  2020-11-13 12:57 ` ericonr
  2020-11-13 16:20 ` [PR PATCH] [Updated] " Logarithmus
@ 2020-11-13 16:21 ` Logarithmus
  2020-11-14  2:04 ` [PR PATCH] [Merged]: " ericonr
  3 siblings, 0 replies; 5+ messages in thread
From: Logarithmus @ 2020-11-13 16:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]

New comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/26347#issuecomment-726857228

Comment:
@ericonr done

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

* Re: [PR PATCH] [Merged]: s3cmd: backport Python 3.9 compatibility fix
  2020-11-13  8:11 [PR PATCH] s3cmd: backport Python 3.9 compatibility fix Logarithmus
                   ` (2 preceding siblings ...)
  2020-11-13 16:21 ` Logarithmus
@ 2020-11-14  2:04 ` ericonr
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2020-11-14  2:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

There's a merged pull request on the void-packages repository

s3cmd: backport Python 3.9 compatibility fix
https://github.com/void-linux/void-packages/pull/26347

Description:
https://github.com/s3tools/s3cmd/issues/1146 is fixed in `master` by https://github.com/s3tools/s3cmd/pull/1137. This PR adds corresponding patch.

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

end of thread, other threads:[~2020-11-14  2:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  8:11 [PR PATCH] s3cmd: backport Python 3.9 compatibility fix Logarithmus
2020-11-13 12:57 ` ericonr
2020-11-13 16:20 ` [PR PATCH] [Updated] " Logarithmus
2020-11-13 16:21 ` Logarithmus
2020-11-14  2:04 ` [PR PATCH] [Merged]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).