From a5c2202d153ff20e85b76cba01d6473cd04ef963 Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Tue, 12 Mar 2024 16:13:58 +0100 Subject: [PATCH] fix(ssh-add-key): decode byte-string error message Popen.communicate returns a byte-string. This needs to be decoded first before passing to the error handler. Signed-off-by: Felix Moessbauer Signed-off-by: Jan Kiszka --- kas/libkas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kas/libkas.py b/kas/libkas.py index 6d60c457..118454ef 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -327,7 +327,7 @@ def ssh_add_key(env, key): stderr=PIPE, env=env) (_, error) = process.communicate(input=str.encode(key)) if process.returncode and error: - logging.error('failed to add ssh key: %s', error) + logging.error('failed to add ssh key: %s', error.decode('utf-8')) def ssh_cleanup_agent():