summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/auth_handler.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py
index 8ecd530e..6cf6565f 100644
--- a/paramiko/auth_handler.py
+++ b/paramiko/auth_handler.py
@@ -197,6 +197,9 @@ class AuthHandler (object):
m.add_string(self.auth_method)
if self.auth_method == 'password':
m.add_boolean(False)
+ password = self.password
+ if isinstance(password, unicode):
+ password = password.encode('UTF-8')
m.add_string(self.password.encode('UTF-8'))
elif self.auth_method == 'publickey':
m.add_boolean(True)