The hmac module won't accept unicode objects so cast them before using
them if they're present.
OAUTH_ROOT = '/oauth/'
def __init__(self, consumer_key, consumer_secret, callback=None, secure=False):
+ if type(consumer_key) == unicode:
+ consumer_key = bytes(consumer_key)
+
+ if type(consumer_secret) == unicode:
+ consumer_secret = bytes(consumer_secret)
+
self._consumer = oauth.OAuthConsumer(consumer_key, consumer_secret)
self._sigmethod = oauth.OAuthSignatureMethod_HMAC_SHA1()
self.request_token = None