Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

int() argument must be a string, a bytes-like object or a number, not 'Sequence' #22

Open
adamcti opened this issue Sep 19, 2022 · 1 comment

Comments

@adamcti
Copy link

adamcti commented Sep 19, 2022

Hello I am getting the error

key = cls(*as_ints)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'Sequence'
when running the code supplied by you guys for python, what could be happening?

@isparks
Copy link
Collaborator

isparks commented Sep 19, 2022

Should be using this library? https://github.com/mdsol/mauth-client-python

Also, what is "cls" here? if its an MAuth class then you can see that it has a constructor that takes a string key and private key data (a bytes-like object).

Here:

https://github.com/mdsol/requests-mauth/blob/master/requests_mauth/client.py#L14

There's an example of creating one in the tests: https://github.com/mdsol/requests-mauth/blob/master/tests/client_test.py#L20

class MAuthBaseTest(unittest.TestCase):
    def setUp(self):
        self.app_id = "5ff4257e-9c16-11e0-b048-0026bbfffe5e"

        # Note, private key used here is just a dummy. Not registered to anythiung, cannot sign live requests.
        dir = os.path.dirname(__file__)
        with open(os.path.join(dir, "test_mauth.priv.key"),'r') as f:
            example_private_key = f.read()
        self.client = MAuth(self.app_id, example_private_key) # <--- HERE TAKING AN APP_ID (string) and the private key (bytes)

You might have to provide a bit more of your program to understand what is going on. Good luck.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants