[hooks] fix extra_props handling on python3
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 22 Dec 2015 10:39:05 +0100
changeset 11038 7cb02ab4f321
parent 11037 621ad47c7c86
child 11039 6424a2e112f5
[hooks] fix extra_props handling on python3 The json module expects str, not bytes, so we need to do the decoding.
hooks/syncschema.py
--- a/hooks/syncschema.py	Tue Dec 22 16:16:07 2015 +0100
+++ b/hooks/syncschema.py	Tue Dec 22 10:39:05 2015 +0100
@@ -463,7 +463,7 @@
                  'fulltextindexed': entity.fulltextindexed,
                  'internationalizable': entity.internationalizable}
         if entity.extra_props:
-            props.update(json.load(entity.extra_props))
+            props.update(json.loads(entity.extra_props.getvalue().decode('ascii')))
         # entity.formula may not exist yet if we're migrating to 3.20
         if hasattr(entity, 'formula'):
             props['formula'] = entity.formula