Skip to content

A bytes-like object is required, not 'str #3

Description

@Gunjan7991

Hello,
I am very grateful for your post. It is very hard to find such valuable material based on SabreAPI elsewhere.
Currently, I'm trying to use your code to make requests to Sabre API. Using Python 3.8, I get the following error when assigning client_id and _secret

sabre = Sabre(key1, key2)
where key1 = client_id
key2 = client_secret
I even tried encoding the keys but it didn't work for me. Currently, I am getting following errors:

Traceback (most recent call last):
File "C:/Users/Home/Desktop/eel/engine/test.py", line 11, in
sabre = Sabre(key1, key2)
File "C:\Users\Home\Desktop\eel\engine\SabreAPI.py", line 41, in init
self.credentials = self.encode_credentials()
File "C:\Users\Home\Desktop\eel\engine\SabreAPI.py", line 96, in encode_credentials
return base64.b64encode("{client_id}:{client_secret}".format(
File "C:\Users\Home\AppData\Local\Programs\Python\Python38\lib\base64.py", line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str

Thank you in advance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions