From a89230eb7f57fe785f6a1a8a06bf4a2b4bf38c4a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 23 Jan 2021 22:21:21 +0800 Subject: [PATCH] bugfix --- kivyblocks/osc_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kivyblocks/osc_server.py b/kivyblocks/osc_server.py index 65160f4..e681c71 100644 --- a/kivyblocks/osc_server.py +++ b/kivyblocks/osc_server.py @@ -40,7 +40,8 @@ class OSCServer(EventDispatcher): print(api, *args) def apihandle(self, api, *args): - data = json.loads(args[0]) + data = args[0].decode('utf-8') + data = json.loads(data) sock, ip_address, response_port = self.osc_server.get_sender() self.dispatch('on_%s' % api, api, data) if api == 'broadcast': @@ -50,6 +51,7 @@ class OSCServer(EventDispatcher): def send_message(self,api, data, addr, port): data = json.dumps(data) + data = data.encode('utf-8') bstr = '/%s' % api bstr = bstr.encode('utf-8') self.osc_server.send_message(b'/broadcast', [data], addr, port)