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'
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.
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(+)
I committed the patch. Please let me know if you're still seeing this error.
(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.