SharpBit / brawlstats

(A)sync python wrapper for the Brawl Stars API
https://brawlstats.rtfd.io/
MIT License
99 stars 24 forks source link

Errors occur when upgrading from version 4.0.0 to 4.0.1 #50

Closed 0dminnimda closed 4 years ago

0dminnimda commented 4 years ago

Describe the bug version 4.0.1 made a mistake in the code.

Full Code `import brawlstats as bs

TOKEN = "some token"

my_tag = "2q0ql2pl".upper()

client = bs.Client(TOKEN)

me = client.get_player(my_tag)

print(me.raw_data['tag'])`

Expected behavior output "#2Q0QL2PL"

Actual behavior Traceback (most recent call last): File "test.py", line 9, in me = client.get_player(my_tag) File "C:\Program Files\Python38\lib\site-packages\brawlstats/utils.py", line 101, in wrapper return func(*new_args, **new_kwargs) File "C:\Program Files\Python38\lib\site-packages\brawlstats/core.py", line 205, in get_player return self._get_model(url, model=Player) File "C:\Program Files\Python38\lib\site-packages\brawlstatss/core.py", line 189, in _get_model return model(self, data) TypeError: init() takes 1 positional argument but 3 were given

Additional context Python Version: 3.8.2 brawlstats Version: 4.0.1 OS (and version): it doesn't matter since it doesn’t work both on my hosting and on my computer (after upgrading from 4.0.0 to 4.0.1)

0dminnimda commented 4 years ago

it is logical to add that the problem is solved by "pip install brawlstats == 4.0.0"

SharpBit commented 4 years ago

Edit your initial comment and remove your token because that can be abused, never post your token publicly. Also, this should be fixed in v4.0.2

0dminnimda commented 4 years ago

Thank you for your concern, I do not think that in this case it was dangerous, I thought twice to publish a token. (in any case, I wrote an already unused token)

0dminnimda commented 4 years ago

in addition, if someone wants to use my token, he will not be able (in this case), because my token has in the white sheet only my ip

0dminnimda commented 4 years ago

and wow, how quickly this is fixed :) version 4.0.2 is already on the network