changeset 2709:46f2733a2a9b

tools (common/data_format): use "default" in json.dumps in serialise (useful notably to serialise jid.JID)
author Goffi <goffi@goffi.org>
date Sat, 01 Dec 2018 14:34:55 +0100
parents 0b5deb9a35fd
children b6e16a89311b
files sat/tools/common/data_format.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/tools/common/data_format.py	Sat Dec 01 10:48:01 2018 +0100
+++ b/sat/tools/common/data_format.py	Sat Dec 01 14:34:55 2018 +0100
@@ -131,7 +131,7 @@
 
     @return(unicode): serialised data, can be transmitted as string to the bridge
     """
-    return json.dumps(data, ensure_ascii=False)
+    return json.dumps(data, ensure_ascii=False, default=unicode)
 
 def deserialise(serialised_data, default=None, type_check=dict):
     """Deserialize data from bridge