diff options
author | Carlos Goncalves <carlos.goncalves@neclab.eu> | 2017-08-16 15:52:30 +0200 |
---|---|---|
committer | Carlos Goncalves <carlos.goncalves@neclab.eu> | 2017-08-16 15:52:30 +0200 |
commit | 580f7ee5064ab2fe6244fa07d7ef3b785de5d926 (patch) | |
tree | 48d597996eb639dfd11525839366ea3162282dc3 | |
parent | d540d3046d2a65ab8c4803c0a03c964558e05f44 (diff) |
Decode received data in byte type to str type
json.loads in Python 3.5 doesn't accept a byte-type values so we need to
decode it. Note that this is specific to Python 3.5; Python 2.7 and 3.6
accept byte-type values.
Change-Id: I490f8e0f02a6ce277f86e75b32d1210bfcca8d49
Signed-off-by: Carlos Goncalves <carlos.goncalves@neclab.eu>
-rw-r--r-- | tests/inspector/sample.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/inspector/sample.py b/tests/inspector/sample.py index db477de9..dda053ab 100644 --- a/tests/inspector/sample.py +++ b/tests/inspector/sample.py @@ -135,7 +135,7 @@ class InspectorApp(Thread): self.log.info('event posted in sample inspector at %s' % time.time()) self.log.info('sample inspector = %s' % self.inspector) self.log.info('sample inspector received data = %s' % request.data) - events = json.loads(request.data) + events = json.loads(request.data.decode('utf8')) self.inspector.handle_events(events) return "OK" |