From a6bc66667bdd316c89ac8027d00272f9f047be9e Mon Sep 17 00:00:00 2001 From: Nigel Dokter Date: Mon, 21 Feb 2022 20:05:23 +0100 Subject: [PATCH] fix FileReader from not completing --- dsmr_parser/clients/filereader.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dsmr_parser/clients/filereader.py b/dsmr_parser/clients/filereader.py index 061eda7..9b9cf6e 100644 --- a/dsmr_parser/clients/filereader.py +++ b/dsmr_parser/clients/filereader.py @@ -64,8 +64,11 @@ class FileReader(object): with open(self._file, "rb") as file_handle: while True: data = file_handle.readline() - str = data.decode() - self.telegram_buffer.append(str) + + if not data: + break + + self.telegram_buffer.append(data.decode()) for telegram in self.telegram_buffer.get_all(): try: