From d894eafc21e34c8bb58d973228b706e9f5c2841d Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Tue, 4 May 2021 22:00:37 -0400 Subject: [PATCH] Catch IncompleteReadError It can happen when the input stream closes after a timeout. --- matrix_puppeteer_line/rpc/rpc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matrix_puppeteer_line/rpc/rpc.py b/matrix_puppeteer_line/rpc/rpc.py index 7b5877c..49e088a 100644 --- a/matrix_puppeteer_line/rpc/rpc.py +++ b/matrix_puppeteer_line/rpc/rpc.py @@ -152,6 +152,9 @@ class RPCClient: try: line += await self._reader.readuntil() break + except asyncio.exceptions.IncompleteReadError as e: + line += e.partial + break except asyncio.exceptions.LimitOverrunError as e: self.log.warning(f"Buffer overrun: {e}") line += await self._reader.read(self._reader._limit)