more robust ouput_grabber

This commit is contained in:
Philippe Teuwen 2024-08-05 23:31:00 +02:00
parent 1e95f70386
commit 11c1c8490c
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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