Skip to content

Problem: <class 'AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren' #1210

@safor

Description

@safor
Invoked as: /usr/bin/s3cmd sync /s3/my-files/ s3://my-files --no-guess-mime-type --delete-removed --delete-after --check-md5 --preserve --dry-run
Problem: <class 'AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
S3cmd:   2.1.0
python:   3.9.5 (default, May 12 2021, 20:44:22)
[GCC 10.3.1 20210424]
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'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 3201, in <module>
    report_exception(e)
  File "/usr/bin/s3cmd", line 3076, in report_exception
    sys.stderr.write(u"environment LANG=%s\n" % unicodise_s(os.getenv("LANG"), 'ascii'))
  File "/usr/lib/python3.9/site-packages/S3/Utils.py", line 321, in unicodise_s
    return unicodise(string, encoding, errors, True)
  File "/usr/lib/python3.9/site-packages/S3/Utils.py", line 312, in unicodise
    return unicode(string, encoding, errors)
TypeError: decoding to str: need a bytes-like object, NoneType found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions