# HG changeset patch # User Julien Cristau # Date 1444728877 -7200 # Node ID d5671a61f281349407d72cd97f7d9d993333b5e5 # Parent 416840faf119d3f797e466bb0422a14346430cba [server/schemaserial] fix extra_props on py3k json.dumps returns unicode, and json.load eats unicode, so add explicit encoding/decoding. diff -r 416840faf119 -r d5671a61f281 server/schemaserial.py --- 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