Skip to content

Commit a084c8f

Browse files
fix: mdstore: fix MetadataStore.dumps(format="md")
MetadataStore.dumps(format="md") was failing with TypeError: Object of type dict_items is not JSON serializable ... because self.items() returns dictitems() - while only a dict would be serializable into JSON. Convert the dictitems back into a dict.
1 parent f72e286 commit a084c8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/saml2/mdstore.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,4 +1693,5 @@ def dumps(self, format="local"):
16931693

16941694
return "%s" % res
16951695
elif format == "md":
1696-
return json.dumps(self.items(), indent=2)
1696+
# self.items() returns dictitems(), convert that back into a dict
1697+
return json.dumps(dict(self.items()), indent=2)

0 commit comments

Comments
 (0)