From 6b9a55e62d04d334cde2d90d19dad8dc4919c0b5 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sat, 7 Jan 2012 00:19:08 -0500 Subject: [PATCH] Sync with Suelta. --- sleekxmpp/features/feature_mechanisms/stanza/auth.py | 2 +- sleekxmpp/thirdparty/suelta/mechanisms/messenger_oauth2.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sleekxmpp/features/feature_mechanisms/stanza/auth.py b/sleekxmpp/features/feature_mechanisms/stanza/auth.py index 9155adf6..d2a981f9 100644 --- a/sleekxmpp/features/feature_mechanisms/stanza/auth.py +++ b/sleekxmpp/features/feature_mechanisms/stanza/auth.py @@ -43,7 +43,7 @@ class Auth(StanzaBase): if not self['mechanism'] in self.plain_mechs: self.xml.text = bytes(base64.b64encode(values)).decode('utf-8') else: - self.xml.text = values + self.xml.text = bytes(values).decode('utf-8') def del_value(self): self.xml.text = '' diff --git a/sleekxmpp/thirdparty/suelta/mechanisms/messenger_oauth2.py b/sleekxmpp/thirdparty/suelta/mechanisms/messenger_oauth2.py index c72bc0e3..f5b0ddec 100644 --- a/sleekxmpp/thirdparty/suelta/mechanisms/messenger_oauth2.py +++ b/sleekxmpp/thirdparty/suelta/mechanisms/messenger_oauth2.py @@ -1,6 +1,5 @@ -from sleekxmpp.thirdparty.suelta.util import hash, bytes +from sleekxmpp.thirdparty.suelta.util import bytes from sleekxmpp.thirdparty.suelta.sasl import Mechanism, register_mechanism -from sleekxmpp.thirdparty.suelta.exceptions import SASLError, SASLCancelled class X_MESSENGER_OAUTH2(Mechanism): @@ -10,7 +9,7 @@ class X_MESSENGER_OAUTH2(Mechanism): self.check_values(['access_token']) def process(self, challenge=None): - return self.values['access_token'] + return bytes(self.values['access_token']) def okay(self): return True