Skip to content

Commit 296141a

Browse files
committed
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 <andrea.cervesato@suse.com>
1 parent 6cdb545 commit 296141a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libkirk/channels/ssh.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,10 @@ async def run_command(
355355

356356
# pyrefly: ignore[missing-attribute]
357357
channel, session = await self._conn.create_session(
358-
lambda: MySSHClientSession(iobuffer), cmd
358+
lambda: MySSHClientSession(iobuffer),
359+
cmd,
360+
encoding="utf-8",
361+
errors="ignore",
359362
)
360363

361364
self._channels.append(channel)

0 commit comments

Comments
 (0)