Skip to content

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

@morettimatheus

Description

@morettimatheus

Hello,
I'm trying to use your code to make requests to Sabre API. First of all I'd like to thank you for uploading this to GitHub 😄

Using Python 3.5, I get the following error when assigning client_id and _secret

client_id = "V1:XXXXXXXXX:DEVCENTER:EXT" client_secret = "XXXXX"

sabre = Sabre(client_id, client_secret)`

Traceback (most recent call last): File "C:/Users/Consultor/Desktop/PYTHON/GetDataQPX/Sabre/request.py", line 6, in <module> sabre = Sabre(client_id, client_secret) File "C:\Users\Consultor\Desktop\PYTHON\GetDataQPX\Sabre\sabreAPI.py", line 49, in __init__ self.credentials = self.encode_credentials() File "C:\Users\Consultor\Desktop\PYTHON\GetDataQPX\Sabre\sabreAPI.py", line 106, in encode_credentials client_id=base64.b64encode(self.client_id), File "C:\Users\Consultor\AppData\Local\Programs\Python\Python35-32\lib\base64.py", line 62, in b64encode encoded = binascii.b2a_base64(s)[:-1] TypeError: a bytes-like object is required, not 'str'

Tried to encode it, but had no success. Could you please help me?

Thankful

Matheus

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