diff --git a/minio/datatypes.py b/minio/datatypes.py index 4090fc972..43b1cac7c 100644 --- a/minio/datatypes.py +++ b/minio/datatypes.py @@ -214,11 +214,13 @@ def fromxml(cls, element, bucket_name, is_delete_marker=False, else (findtext(tag, "ID"), findtext(tag, "DisplayName")) ) - tag = find(element, "UserMetadata") or [] metadata = {} - for child in tag: - key = child.tag.split("}")[1] if "}" in child.tag else child.tag - metadata[key] = child.text + selement = find(element, "UserMetadata") + if selement: + for child in findall(selement, "Items"): + key = findtext(child, "Key", True) + value = findtext(child, "Value", True) + metadata[key] = value object_name = findtext(element, "Key", True) if encoding_type == "url":