Fixing linebreaks and wrong encoding when calling ssh-add on Windows (#39)

lyc8503's change that fixes issue #38
This commit is contained in:
charmparticle 2023-06-14 05:58:53 -07:00 committed by GitHub
parent fc541f0e97
commit fee2a97e30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 # CAVEAT: `ssh-add` provides no useful output, even with maximum verbosity
subprocess.run( subprocess.run(
["ssh-add", "-"], ["ssh-add", "-"],
input=ssh_key, input=ssh_key.encode("utf-8"),
# Works even if ssh-askpass is not installed # Works even if ssh-askpass is not installed
env=envdict, env=envdict,
universal_newlines=True, universal_newlines=False,
check=True, check=True,
) )