From 3a3c696fedc6ae829c8c47457f3fcdad2522c58c Mon Sep 17 00:00:00 2001 From: Andrea Cervesato Date: Tue, 9 Dec 2025 13:01:20 +0100 Subject: [PATCH] ssh: ignore decoding errors in utf-8 during connection Ignore encoding errors with utf-8 during SSH connection. This will fix situations where asyncssh can't start connecting to an SSH server due to the following error: "Connection failure: 'utf-8' codec can't decode byte 0xYY in position XYZ." Signed-off-by: Andrea Cervesato --- libkirk/channels/ssh.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libkirk/channels/ssh.py b/libkirk/channels/ssh.py index 185bc08..c7e9974 100644 --- a/libkirk/channels/ssh.py +++ b/libkirk/channels/ssh.py @@ -355,7 +355,10 @@ async def run_command( # pyrefly: ignore[missing-attribute] channel, session = await self._conn.create_session( - lambda: MySSHClientSession(iobuffer), cmd + lambda: MySSHClientSession(iobuffer), + cmd, + encoding="utf-8", + errors="ignore", ) self._channels.append(channel)