The sync includes change that drastically enhances performance on Python
2.6 with fresh simplejson library installed.
The latest commit in oslo-incubator:
-
0f4586c0076183c6356eec682c8a593648125abd
The following changes are included with this patch:
->
18f2bc1 Enforce unicode json output for jsonutils.load[s]()
--> cinder/openstack/common/jsonutils.py
Change-Id: Ib3dc0b713ed90396919feba018772243b3b9c90f
Closes-Bug:
1314129
'''
+import codecs
import datetime
import functools
import inspect
from cinder.openstack.common import gettextutils
from cinder.openstack.common import importutils
+from cinder.openstack.common import strutils
from cinder.openstack.common import timeutils
netaddr = importutils.try_import("netaddr")
return json.dumps(value, default=default, **kwargs)
-def loads(s):
- return json.loads(s)
+def loads(s, encoding='utf-8'):
+ return json.loads(strutils.safe_decode(s, encoding))
-def load(fp):
- return json.load(fp)
+def load(fp, encoding='utf-8'):
+ return json.load(codecs.getreader(encoding)(fp))
try: