summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
authorSean McCully <sean.mccully@rackspace.com>2012-12-17 10:25:19 -0600
committerSean McCully <sean.mccully@rackspace.com>2013-01-03 10:46:19 -0600
commite3ddc41f1b02644d7fae4482c4beade7f27e58de (patch)
tree95f2d9c6ea1b8dde6ba6fdce41ee1d75f929e8e3 /openstack/common
parent91c9631bd3e3a0c72b36840ddf90e1db483f9a14 (diff)
downloadoslo-e3ddc41f1b02644d7fae4482c4beade7f27e58de.tar.gz
oslo-e3ddc41f1b02644d7fae4482c4beade7f27e58de.tar.xz
oslo-e3ddc41f1b02644d7fae4482c4beade7f27e58de.zip
JSONDictSerializer encode objects to unicode
Averts raising ValueError, Circular Reference Detected exception. Add additional test to JSONDictSerializerTest testing that JSONDictSerializer correctly serializes objects into unicode repr. and not raise error Fixes: bug #1089100 Change-Id: Ifdb0562c7c43ab66617dddb65f16f893df2f4895
Diffstat (limited to 'openstack/common')
-rw-r--r--openstack/common/wsgi.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/openstack/common/wsgi.py b/openstack/common/wsgi.py
index f52fca0..1d6d9df 100644
--- a/openstack/common/wsgi.py
+++ b/openstack/common/wsgi.py
@@ -387,7 +387,7 @@ class JSONDictSerializer(DictSerializer):
if isinstance(obj, datetime.datetime):
_dtime = obj - datetime.timedelta(microseconds=obj.microsecond)
return _dtime.isoformat()
- return obj
+ return unicode(obj)
return jsonutils.dumps(data, default=sanitizer)