[Python 3]: Added fix for bytestring instead of unicode string decoding in Python 3.
This commit is contained in:
parent
9ffd9efb20
commit
3cb91a0e9e
|
@ -26,6 +26,7 @@ import os
|
||||||
|
|
||||||
from Crypto.Hash import MD5
|
from Crypto.Hash import MD5
|
||||||
from Crypto.Cipher import DES3, AES
|
from Crypto.Cipher import DES3, AES
|
||||||
|
import six
|
||||||
|
|
||||||
from paramiko.common import *
|
from paramiko.common import *
|
||||||
from paramiko import util
|
from paramiko import util
|
||||||
|
@ -303,7 +304,7 @@ class PKey (object):
|
||||||
end += 1
|
end += 1
|
||||||
# if we trudged to the end of the file, just try to cope.
|
# if we trudged to the end of the file, just try to cope.
|
||||||
try:
|
try:
|
||||||
data = base64.decodestring(''.join(lines[start:end]))
|
data = base64.decodestring(six.b(''.join(lines[start:end])))
|
||||||
except base64.binascii.Error as e:
|
except base64.binascii.Error as e:
|
||||||
raise SSHException('base64 decoding error: ' + str(e))
|
raise SSHException('base64 decoding error: ' + str(e))
|
||||||
if 'proc-type' not in headers:
|
if 'proc-type' not in headers:
|
||||||
|
|
Loading…
Reference in New Issue