Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 789102 - net-misc/s3cmd-2.1.0 is incompatible with Python 3.9: 'AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
Summary: net-misc/s3cmd-2.1.0 is incompatible with Python 3.9: 'AttributeError: 'xml.e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Igor Testen
URL: https://github.com/s3tools/s3cmd/comm...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: py39, python3.9-compat
  Show dependency tree
 
Reported: 2021-05-09 18:23 UTC by Matt Whitlock
Modified: 2021-05-12 01:05 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2021-05-09 18:23:40 UTC
My backup script has broken after upgrading to Python 3.9 due to an incompatibility in s3cmd. The problem has already fixed in upstream master (see URL in "See Also"), but net-misc/s3cmd-2.1.0 should not list python3_9 in PYTHON_COMPAT.

Problem: <class 'AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
S3cmd:   2.1.0
python:   3.9.5 (default, May  7 2021, 14:12:51)
[GCC 11.1.0]
environment LANG=en_US.UTF-8

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/s3cmd", line 3121, in <module>
    rc = main()
  File "/usr/lib/python-exec/python3.9/s3cmd", line 3030, in main
    rc = cmd_func(args)
  File "/usr/lib/python-exec/python3.9/s3cmd", line 152, in cmd_ls
    subcmd_bucket_list(s3, uri, cfg.limit)
  File "/usr/lib/python-exec/python3.9/s3cmd", line 188, in subcmd_bucket_list
    response = s3.bucket_list(bucket, prefix = prefix, limit = limit)
  File "/usr/lib/python3.9/site-packages/S3/S3.py", line 321, in bucket_list
    for truncated, dirs, objects in self.bucket_list_streaming(bucket, prefix, recursive, uri_params, limit):
  File "/usr/lib/python3.9/site-packages/S3/S3.py", line 356, in bucket_list_streaming
    current_list = _get_contents(response["data"])
  File "/usr/lib/python3.9/site-packages/S3/S3.py", line 339, in _get_contents
    return getListFromXml(data, "Contents")
  File "/usr/lib/python3.9/site-packages/S3/Utils.py", line 120, in getListFromXml
    return parseNodes(nodes)
  File "/usr/lib/python3.9/site-packages/S3/Utils.py", line 67, in parseNodes
    for child in node.getchildren():
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
Comment 1 Matt Whitlock 2021-05-09 18:35:47 UTC
In particular, this commit is the one that should fix it:

https://github.com/s3tools/s3cmd/commit/328ced84fe688db5ef0385f5c763cd948087d81f#diff-66d3f7866f4400f61e4887b9231915969429c033a6ac056ee7f18f9284fe3048

Maybe s3cmd 2.1.0 can be hotfixed with that patch if a new release isn't tagged yet.
Comment 2 Larry the Git Cow gentoo-dev 2021-05-10 17:33:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c74de5f9e7912ccf9667f9c363059e128b5d3e62

commit c74de5f9e7912ccf9667f9c363059e128b5d3e62
Author:     Richard Freeman <rich0@gentoo.org>
AuthorDate: 2021-05-10 17:32:54 +0000
Commit:     Richard Freeman <rich0@gentoo.org>
CommitDate: 2021-05-10 17:32:54 +0000

    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@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(+)
Comment 3 Richard Freeman gentoo-dev 2021-05-10 17:33:26 UTC
I committed the patch.  Please let me know if you're still seeing this error.
Comment 4 Matt Whitlock 2021-05-12 01:05:36 UTC
(In reply to Richard Freeman from comment #3)
> I committed the patch.  Please let me know if you're still seeing this error.

The problem I was having with s3cmd on Python 3.9 has disappeared with your patch. Thank you.