pylightning: Fix missing encode if first pass fails

Without this the RPC will fail to continue buffering if the response does not
fit in the first read, and if we don't switch over to the non-compat
mode. This was introduced by our mitigation of the UTF-8 misalignment, but I
missed this path.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-02-22 16:00:05 +01:00
committed by neil saitug
parent 998233efc0
commit e79fbb6812

View File

@@ -160,7 +160,7 @@ class UnixDomainSocketRpc(object):
return objs, buff
except ValueError:
# Probably didn't read enough
pass
buff = buff.lstrip().encode("UTF-8")
def _readobj(self, sock, buff=b''):
"""Read a JSON object, starting with buff; returns object and any buffer left over"""