From e79fbb681237a804aeda5fecf78f02ef1de01d7e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 22 Feb 2019 16:00:05 +0100 Subject: [PATCH] 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 --- contrib/pylightning/lightning/lightning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pylightning/lightning/lightning.py b/contrib/pylightning/lightning/lightning.py index 29f0cb5a3..b8332c369 100644 --- a/contrib/pylightning/lightning/lightning.py +++ b/contrib/pylightning/lightning/lightning.py @@ -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"""