From 3cb91a0e9e85ecf5f614ffda46e383649f1d6081 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Fri, 25 Oct 2013 17:29:32 -0400 Subject: [PATCH] [Python 3]: Added fix for bytestring instead of unicode string decoding in Python 3. --- paramiko/pkey.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paramiko/pkey.py b/paramiko/pkey.py index e925bb6..cbc1837 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -26,6 +26,7 @@ import os from Crypto.Hash import MD5 from Crypto.Cipher import DES3, AES +import six from paramiko.common import * from paramiko import util @@ -303,7 +304,7 @@ class PKey (object): end += 1 # if we trudged to the end of the file, just try to cope. try: - data = base64.decodestring(''.join(lines[start:end])) + data = base64.decodestring(six.b(''.join(lines[start:end]))) except base64.binascii.Error as e: raise SSHException('base64 decoding error: ' + str(e)) if 'proc-type' not in headers: