From 61777edea42f08de76fc2fd99602c988d1fdf604 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 15 Mar 2015 13:24:21 -0400 Subject: This wants a string, not bytes, apparently --- paramiko/ecdsakey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paramiko/ecdsakey.py b/paramiko/ecdsakey.py index d0259c1f..604152e8 100644 --- a/paramiko/ecdsakey.py +++ b/paramiko/ecdsakey.py @@ -146,12 +146,12 @@ class ECDSAKey(PKey): return True def write_private_key_file(self, filename, password=None): - with open(filename, "wb") as f: + with open(filename, "w") as f: self.write_private_key(f, password=password) def write_private_key(self, file_obj, password=None): key = self.signing_key or self.verifying_key - file_obj.write(self._to_pem(key, password=password)) + file_obj.write(self._to_pem(key, password=password).decode()) @staticmethod def generate(curve=ec.SECP256R1(), progress_func=None): -- cgit v1.2.3