From fee2a97e308f8d09cb265b48ea072a759926de02 Mon Sep 17 00:00:00 2001 From: charmparticle <2414279+charmparticle@users.noreply.github.com> Date: Wed, 14 Jun 2023 05:58:53 -0700 Subject: [PATCH] Fixing linebreaks and wrong encoding when calling ssh-add on Windows (#39) lyc8503's change that fixes issue #38 --- bw_add_sshkeys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bw_add_sshkeys.py b/bw_add_sshkeys.py index 0a8320e..f270eb7 100755 --- a/bw_add_sshkeys.py +++ b/bw_add_sshkeys.py @@ -205,10 +205,10 @@ def ssh_add(session: str, item_id: str, key_id: str, key_pw: str = "") -> None: # CAVEAT: `ssh-add` provides no useful output, even with maximum verbosity subprocess.run( ["ssh-add", "-"], - input=ssh_key, + input=ssh_key.encode("utf-8"), # Works even if ssh-askpass is not installed env=envdict, - universal_newlines=True, + universal_newlines=False, check=True, )