Skip to content

Commit

Permalink
list_objecst: fix parsing user metadata as per MinIO server (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored Sep 27, 2022
1 parent bed40f7 commit f764d45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions minio/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit f764d45

Please sign in to comment.