You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to get an application token and am getting Traceback (most recent call last): File "query.py", line 150, in <module> main() File "query.py", line 142, in main app_token = oauth.get_application_token(env_type = environment.PRODUCTION, scopes = constant.SCOPE) File "/mnt/c/Users/Zack/Documents/src/CardMonitor/ebay_oauth_python_client/oauthclient/oauth2api.py", line 75, in get_application_token headers = model.util._generate_request_headers(credential) File "/mnt/c/Users/Zack/Documents/src/CardMonitor/ebay_oauth_python_client/oauthclient/model/util.py", line 23, in _generate_request_headers b64_encoded_credential = base64.b64encode(credential.client_id + ':' + credential.client_secret) File "/usr/lib/python3.8/base64.py", line 58, in b64encode encoded = binascii.b2a_base64(s, newline=False) TypeError: a bytes-like object is required, not 'str'
There don't appear to be any issues loading credentials. My config file is an exact copy of the provided sample, with my keys replaced of course.
And this is what my script looks like thus far: def main():\ print("Hello World!") print("loading credential...") credentialutil.load('config.json') print("...loaded?") oauth = oauth2api() app_token = oauth.get_application_token(env_type = environment.PRODUCTION, scopes = constant.SCOPE) print(app_token)
Thanks for any help! This is my first time using OAuth and also my first GitHub issue... Cheers
P.S. My apologies, I'm unsure how to include linebreaks here.
The text was updated successfully, but these errors were encountered:
Python 3 introduced some changes to text and binary data types (see Porting Python 2 Code to Python 3). I got around this issue with the following changes to oauthclient/model/util.py:
Uh oh!
There was an error while loading. Please reload this page.
Trying to get an application token and am getting
Traceback (most recent call last): File "query.py", line 150, in <module> main() File "query.py", line 142, in main app_token = oauth.get_application_token(env_type = environment.PRODUCTION, scopes = constant.SCOPE) File "/mnt/c/Users/Zack/Documents/src/CardMonitor/ebay_oauth_python_client/oauthclient/oauth2api.py", line 75, in get_application_token headers = model.util._generate_request_headers(credential) File "/mnt/c/Users/Zack/Documents/src/CardMonitor/ebay_oauth_python_client/oauthclient/model/util.py", line 23, in _generate_request_headers b64_encoded_credential = base64.b64encode(credential.client_id + ':' + credential.client_secret) File "/usr/lib/python3.8/base64.py", line 58, in b64encode encoded = binascii.b2a_base64(s, newline=False) TypeError: a bytes-like object is required, not 'str'
There don't appear to be any issues loading credentials. My config file is an exact copy of the provided sample, with my keys replaced of course.
And this is what my script looks like thus far:
def main():\ print("Hello World!") print("loading credential...") credentialutil.load('config.json') print("...loaded?") oauth = oauth2api() app_token = oauth.get_application_token(env_type = environment.PRODUCTION, scopes = constant.SCOPE) print(app_token)
Thanks for any help! This is my first time using OAuth and also my first GitHub issue... Cheers
P.S. My apologies, I'm unsure how to include linebreaks here.
The text was updated successfully, but these errors were encountered: