From 11c1c8490cd97a9f0ddcad1b8562520123e7431a Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 5 Aug 2024 23:31:00 +0200 Subject: [PATCH] more robust ouput_grabber --- client/experimental_client_with_swig/output_grabber.py | 2 +- client/experimental_lib/example_py/output_grabber.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/experimental_client_with_swig/output_grabber.py b/client/experimental_client_with_swig/output_grabber.py index a62d6f056..ca9828149 100755 --- a/client/experimental_client_with_swig/output_grabber.py +++ b/client/experimental_client_with_swig/output_grabber.py @@ -72,7 +72,7 @@ class OutputGrabber(object): and save the text in `capturedtext`. """ while True: - char = os.read(self.pipe_out,1).decode(self.origstream.encoding) + char = os.read(self.pipe_out,1).decode(self.origstream.encoding, errors='replace') if not char or self.escape_char in char: break self.capturedtext += char diff --git a/client/experimental_lib/example_py/output_grabber.py b/client/experimental_lib/example_py/output_grabber.py index a62d6f056..ca9828149 100755 --- a/client/experimental_lib/example_py/output_grabber.py +++ b/client/experimental_lib/example_py/output_grabber.py @@ -72,7 +72,7 @@ class OutputGrabber(object): and save the text in `capturedtext`. """ while True: - char = os.read(self.pipe_out,1).decode(self.origstream.encoding) + char = os.read(self.pipe_out,1).decode(self.origstream.encoding, errors='replace') if not char or self.escape_char in char: break self.capturedtext += char