summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2008-01-21 11:08:42 -0800
committerRobey Pointer <robey@lag.net>2008-01-21 11:08:42 -0800
commit38835bc24ca147b46470d063bce94670eaf901f8 (patch)
tree149e9f2acb5d9f9da2a5550f23c73143a0f98fdc
parentba1fd0d61bc5c103004d496473681b2a4dce0f3b (diff)
[project @ robey@lag.net-20080121190842-mq94nybu8qxhw1jl]
for password authentication, only utf-8 encode the password if it's in unicode. this should let clients work around servers that expect non-utf-8 passwords (possibly because they predate the RFCs).
-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)