jsonutils.to_primitive does not follow the protocol required by json.dump
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.serialization |
Triaged
|
Medium
|
Unassigned |
Bug Description
"If specified, default should be a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError. If not specified, TypeError is raised." [1]
So jsonutils.
i) it returns the same object if the object is not serializable instead of raising TypeError
ii) it warns the user of the lib that ValueError will be raised from 3.0 instead of TypeError
iii) oslo.serialization 3.0 is released without changing that warning to a real exception raise
[1] https:/
[2] https:/
It looks like we need to address Glance before we remove this. I see the warning occurring in their logs on a regular basis: http:// logstash. openstack. org/#dashboard/ file/logstash. json?query= message% 3A%5C%22will% 20raise% 20ValueError% 5C%22