Skip to content

Commit 631e8a5

Browse files
committed
fix problem with python3.6
1 parent 6689960 commit 631e8a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def sign_request(self, signature_method, consumer, token):
490490
# section 4.1.1 "OAuth Consumers MUST NOT include an
491491
# oauth_body_hash parameter on requests with form-encoded
492492
# request bodies."
493-
self['oauth_body_hash'] = base64.b64encode(sha1(self.body).digest())
493+
self['oauth_body_hash'] = base64.b64encode(sha1(to_utf8(self.body)).digest())
494494

495495
if 'oauth_consumer_key' not in self:
496496
self['oauth_consumer_key'] = consumer.key

0 commit comments

Comments
 (0)