diff sat/tools/common/data_format.py @ 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 fcc945537d5f
children 003b8b4b56a7
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