diff --git a/framework/core/commandModules/sshConsole.py b/framework/core/commandModules/sshConsole.py index e3b1ed5..3742750 100644 --- a/framework/core/commandModules/sshConsole.py +++ b/framework/core/commandModules/sshConsole.py @@ -103,7 +103,14 @@ def read_until(self, value, timeout=10) -> str: while time.time() < end_time: if self.shell.recv_ready(): - output += self.shell.recv(4096).decode('utf-8') + try: + # Read the output from the shell + raw_output = self.shell.recv(4096) + output += raw_output.decode('utf-8') + except UnicodeDecodeError as e: + self.log.critical(f"UnicodeDecodeError - {e}") + # Fallback to safer decoding of the same raw data without crashing + output += raw_output.decode('utf-8', errors='replace') # Reset the timeout if new data is received end_time = time.time() + timeout