[server/schemaserial] fix extra_props on py3k
json.dumps returns unicode, and json.load eats unicode, so add explicit
encoding/decoding.
--- a/server/schemaserial.py Tue Oct 13 11:30:48 2015 +0200
+++ b/server/schemaserial.py Tue Oct 13 11:34:37 2015 +0200
@@ -243,7 +243,7 @@
'order', 'description', 'indexed', 'fulltextindexed',
'internationalizable', 'default', 'formula'), values))
typeparams = extra_props.get(attrs['rdefeid'])
- attrs.update(json.load(typeparams) if typeparams else {})
+ attrs.update(json.loads(typeparams.getvalue().decode('ascii')) if typeparams else {})
default = attrs['default']
if default is not None:
if isinstance(default, Binary):
@@ -590,7 +590,7 @@
value = Binary.zpickle(value)
values[amap.get(prop, prop)] = value
if extra:
- values['extra_props'] = Binary(json.dumps(extra))
+ values['extra_props'] = Binary(json.dumps(extra).encode('ascii'))
relations = ['X %s %%(%s)s' % (attr, attr) for attr in sorted(values)]
return relations, values