Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.9: AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren' #1157

Closed
tycho opened this issue Dec 2, 2020 · 1 comment

Comments

@tycho
Copy link
Contributor

tycho commented Dec 2, 2020

When doing an s3cmd sync --delete-removed --follow-symlinks -P somedir/. s3://somebucket/somedir/

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 3121, in <module>
    rc = main()
  File "/usr/bin/s3cmd", line 3030, in main
    rc = cmd_func(args)
  File "/usr/bin/s3cmd", line 1898, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/usr/bin/s3cmd", line 1871, in cmd_sync_local2remote
    ret = _single_process(args[:-1])
  File "/usr/bin/s3cmd", line 1625, in _single_process
    return _child(destination_base, source_args)
  File "/usr/bin/s3cmd", line 1729, in _child
    remote_list, dst_exclude_list, remote_total_size = fetch_remote_list(destbase_with_source_list, recursive = True, require_attribs = True)
  File "/usr/lib/python3.9/site-packages/S3/FileLists.py", line 471, in fetch_remote_list
    objectlist, tmp_total_size = _get_filelist_remote(uri, recursive = True)
  File "/usr/lib/python3.9/site-packages/S3/FileLists.py", line 407, in _get_filelist_remote
    response = s3.bucket_list(remote_uri.bucket(), prefix = remote_uri.object(),
  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'

Similar to issues reported on other projects:
ocrmypdf/OCRmyPDF#583
openmm/openmm#2887

It looks like for child in node.getchildren(): should just be for child in node:?

@tycho
Copy link
Contributor Author

tycho commented Dec 2, 2020

Oops, just saw this is fixed in the master branch. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant