Thomas Krichel writes:
File "/usr/lib/python3.12/json/encoder.py", line 180, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type set is not JSON serializable
This appears to be related to https://gitlab.com/mailman/mailman/-/work_items/668. There's a patch at the end that may help. I can't promise it will. But I have assigned the issue to myself for later followup.
I suspect that to get to the bottom of this problem, I need to use the low-level postorious functions that actually access the parse the held message data.
No, I think you want to make sure that the REST API doesn't pass a set to the JSON encoder. I suppose that there are a bunch of "things" there that might be "the same", and the developer who wrote the code wanted to compress the representation a bit. But they didn't realize that sets won't be serialized by the stdlib json module. I doubt very much that Postorius cares: it probably just treats that object as a sequence.
I don't understand why sets (like tuples and lists) don't just encode to JSON sequences, and let the deserializer decide which model is best for the container, but that's life, I guess.
Regards, Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan