From 2124bdca266f14a922010bd18a09c80c9b9917d6 Mon Sep 17 00:00:00 2001 From: Yoann QUERET Date: Mon, 18 Jan 2021 10:48:37 +0100 Subject: Make compatible with python 3.5 Solve error "TypeError: the JSON object must be str, not 'bytes'" with python 3.5 --- doc/show_dabmux_stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/show_dabmux_stats.py b/doc/show_dabmux_stats.py index 75998a5..6821296 100755 --- a/doc/show_dabmux_stats.py +++ b/doc/show_dabmux_stats.py @@ -22,7 +22,7 @@ def connect(): sock.connect("tcp://localhost:12720") sock.send(b"info") - infojson = json.loads(sock.recv()) + infojson = json.loads(sock.recv().decode("utf-8")) sys.stderr.write("Statistics from ODR-DabMux {}\n".format(infojson['version'])) @@ -43,7 +43,7 @@ if len(sys.argv) == 1: if socks: if socks.get(sock) == zmq.POLLIN: - data = sock.recv() + data = sock.recv().decode("utf-8") values = json.loads(data)['values'] tmpl = "{ident:20}{maxfill:>8}{minfill:>8}{under:>8}{over:>8}{audioleft:>8}{audioright:>8}{peakleft:>8}{peakright:>8}{state:>16}{version:>48}{uptime:>8}" -- cgit v1.2.3