Permalink
Browse files

Merge pull request #2 from osman/python3

make sure oauth headers are not bytestrings
  • Loading branch information...
2 parents b1c0d46 + a90b562 commit fbfec7d78ea409ee699f25bf4e9d698fbfc58a58 @hades committed Sep 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 oauth2/__init__.py
View
@@ -470,7 +470,7 @@ def sign_request(self, signature_method, consumer, token):
# section 4.1.1 "OAuth Consumers MUST NOT include an
# oauth_body_hash parameter on requests with form-encoded
# request bodies."
- self['oauth_body_hash'] = base64.b64encode(sha(self.body.encode('utf8')).digest())
+ self['oauth_body_hash'] = base64.b64encode(sha(self.body.encode('utf8')).digest()).decode('utf-8')
if 'oauth_consumer_key' not in self:
self['oauth_consumer_key'] = consumer.key
@@ -479,7 +479,7 @@ def sign_request(self, signature_method, consumer, token):
self['oauth_token'] = token.key
self['oauth_signature_method'] = signature_method.name
- self['oauth_signature'] = signature_method.sign(self, consumer, token)
+ self['oauth_signature'] = signature_method.sign(self, consumer, token).decode('utf-8')
@classmethod
def make_timestamp(cls):

0 comments on commit fbfec7d

Please sign in to comment.