Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 8327fed

Browse files
committed
fix broken calls to get oauth2 token under python3 following some new checks ran on Twitter servers (thx @Yomguithereal)
1 parent 17b49c2 commit 8327fed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

twitter/oauth2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ def encode_params(self, base_url, method, params):
7676
def generate_headers(self):
7777
if self.bearer_token:
7878
headers = {
79-
b'Authorization': 'Bearer {0}'.format(
79+
'Authorization': 'Bearer {0}'.format(
8080
self.bearer_token).encode('utf8')
8181
}
8282
else:
8383
headers = {
84-
b'Content-Type': (b'application/x-www-form-urlencoded;'
84+
'Content-Type': (b'application/x-www-form-urlencoded;'
8585
b'charset=UTF-8'),
86-
b'Authorization': 'Basic {0}'.format(
86+
'Authorization': 'Basic {0}'.format(
8787
b64encode('{0}:{1}'.format(
8888
quote(self.consumer_key),
8989
quote(self.consumer_secret)).encode('utf8')

0 commit comments

Comments
 (0)