scripts/rpc.py: explicitly en/decode socket data
This is required to work on Python 3. Change-Id: I1893d967027e3ccebfc6a796dcffa59209d477f9 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/404434 Reviewed-by: Paul Luse <paul.e.luse@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
e78866edf0
commit
b1bdc370ca
@ -41,7 +41,7 @@ class JSONRPCClient(object):
|
||||
print("request:")
|
||||
print(json.dumps(req, indent=2))
|
||||
|
||||
self.sock.sendall(reqstr)
|
||||
self.sock.sendall(reqstr.encode("utf-8"))
|
||||
buf = ''
|
||||
closed = False
|
||||
response = {}
|
||||
@ -58,7 +58,7 @@ class JSONRPCClient(object):
|
||||
if (newdata == b''):
|
||||
closed = True
|
||||
|
||||
buf += newdata
|
||||
buf += newdata.decode("utf-8")
|
||||
response = json.loads(buf)
|
||||
except socket.timeout:
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user