Comment 1 for bug 1756360

Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

"This is resulting in the Exception kwargs being stripped from the serialized Exception."
I tried to reproduce that before the referenced oslo.serialization change the kwargs of the Exception is serialized. But I failed:

(py27) ebalgib@elxa95hld12:~/upstream/git/oslo.serialization$ pip freeze | grep seriali
oslo.serialization==2.21.1
(py27) ebalgib@elxa95hld12:~/upstream/git/oslo.serialization$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyException(Exception):
... def __init__(self, named_arg):
... super(MyException, self).__init__('message')
...
>>> from oslo_serialization import jsonutils
>>> print jsonutils.to_primitive(MyException(named_arg='alma'))
oslo_serialization/jsonutils.py:188: UserWarning: Cannot convert MyException('message',) to primitive, will raise ValueError instead of warning in version 3.0
  "instead of warning in version 3.0" % (value,))
message

Could you attach some logs that shows that Exception kwargs being serialized with old enough oslo serialization?