Skip to content

Commit

Permalink
pylightning: Fix missing encode if first pass fails
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cdecker committed Feb 22, 2019
1 parent 8fb2e6b commit 55d59af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/pylightning/lightning/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _readobj_compat(self, sock, buff=b''):
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"""
Expand Down

0 comments on commit 55d59af

Please sign in to comment.