--- a/RefactoringRope/JsonClient.py Sun Dec 24 17:03:03 2017 +0100 +++ b/RefactoringRope/JsonClient.py Sun Dec 31 15:09:23 2017 +0100 @@ -72,12 +72,17 @@ # step 1: receive the data # The JSON RPC string is prefixed by a 9 character long length field. length = self.__connection.recv(9) + if len(length) < 9: + # invalid length string received + return None, None + length = int(length) data = b'' while len(data) < length: newData = self.__connection.recv(length - len(data)) if not newData: return None, None + data += newData # step 2: decode and convert the data