Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion framework/core/commandModules/sshConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down