Commit 81658a99 authored by Aaron Hill's avatar Aaron Hill
Browse files

Merge pull request #354 from lysol/master

Add unicode type detection for consumer key/secret
parents f2699789 5a22bf73
...@@ -28,6 +28,12 @@ class OAuthHandler(AuthHandler): ...@@ -28,6 +28,12 @@ class OAuthHandler(AuthHandler):
OAUTH_ROOT = '/oauth/' OAUTH_ROOT = '/oauth/'
def __init__(self, consumer_key, consumer_secret, callback=None, secure=False): 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._consumer = oauth.OAuthConsumer(consumer_key, consumer_secret)
self._sigmethod = oauth.OAuthSignatureMethod_HMAC_SHA1() self._sigmethod = oauth.OAuthSignatureMethod_HMAC_SHA1()
self.request_token = None self.request_token = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment