Skip to content

Commit

Permalink
list_objecst: fix parsing user metadata as per MinIO server
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed Sep 26, 2022
1 parent bed40f7 commit 8bd6497
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions minio/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ 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")
for child in findall(selement, "Items"):
metadata[find(child, "Key").text] = find(child, "Value").text

object_name = findtext(element, "Key", True)
if encoding_type == "url":
Expand Down

0 comments on commit 8bd6497

Please sign in to comment.