From 159c7a9a52717c5d0aceb3bd8a579712d01b4dae Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 8 Mar 2023 14:10:33 +0100 Subject: [PATCH] Fixed rnstatus JSON output error --- RNS/Utilities/rnstatus.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RNS/Utilities/rnstatus.py b/RNS/Utilities/rnstatus.py index ab5514a..187aa2f 100644 --- a/RNS/Utilities/rnstatus.py +++ b/RNS/Utilities/rnstatus.py @@ -58,6 +58,16 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None,json=F if stats != None: if json: import json + for s in stats: + if isinstance(stats[s], bytes): + stats[s] = RNS.hexrep(stats[s], delimit=False) + + for i in stats[s]: + if isinstance(i, dict): + for k in i: + if isinstance(i[k], bytes): + i[k] = RNS.hexrep(i[k], delimit=False) + print(json.dumps(stats)) exit()