From 0114b3082421df015da3ba021b714f5d6f2f51ce Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 19 Jun 2025 14:49:50 +0200 Subject: [PATCH] Solved EOL bug --- main.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index de1a75f4..286f3914 100755 --- a/main.py +++ b/main.py @@ -162,12 +162,17 @@ if __name__ == "__main__": text=True ) os.close(slave_fd) + import errno with os.fdopen(master_fd) as master: - for line in master: - ts = datetime.now().strftime('%Y-%m-%dT%H:%M:%S') - log_file.write(f"{ts} {line}") - log_file.flush() - print(line, end='') + try: + for line in master: + ts = datetime.now().strftime('%Y-%m-%dT%H:%M:%S') + log_file.write(f"{ts} {line}") + log_file.flush() + print(line, end='') + except OSError as e: + if e.errno != errno.EIO: + raise proc.wait() rc = proc.returncode else: