Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with python 3.9 #61

Open
JustDevZero opened this issue Feb 14, 2021 · 1 comment
Open

Not compatible with python 3.9 #61

JustDevZero opened this issue Feb 14, 2021 · 1 comment

Comments

@JustDevZero
Copy link

JustDevZero commented Feb 14, 2021

If i try to install pykeybasebot on python3.9, even pip doesn't argue against and installs it succesfully it looks like part of the code is not yet compatible:


kbot    | Traceback (most recent call last):
kbot    |   File "/home/keybase/project/kbot.py", line 474, in <module>
kbot    |     pingbot.run()
kbot    |   File "/home/keybase/project/kbot.py", line 78, in run
kbot    |     asyncio.run(self._bot.start(listen_options))
kbot    |   File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
kbot    |     return loop.run_until_complete(main)
kbot    |   File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
kbot    |     return future.result()
kbot    |   File "/home/keybase/virtualenv/lib/python3.9/site-packages/pykeybasebot/bot.py", line 25, in wrapped_f
kbot    |     await keybase_bot_start_function(self, *args, **kwargs)
kbot    |   File "/home/keybase/virtualenv/lib/python3.9/site-packages/pykeybasebot/bot.py", line 93, in start
kbot    |     async for event in events:
kbot    |   File "/home/keybase/virtualenv/lib/python3.9/site-packages/pykeybasebot/cli.py", line 53, in kblisten
kbot    |     yield KbEvent.from_json(decoded_line)
kbot    |   File "/home/keybase/virtualenv/lib/python3.9/site-packages/dataclasses_json/api.py", line 135, in from_json
kbot    |     kvs = json.loads(s,
kbot    |   File "/usr/local/lib/python3.9/json/__init__.py", line 359, in loads
kbot    |     return cls(**kw).decode(s)
kbot    | TypeError: __init__() got an unexpected keyword argument 'encoding'

That appears to be, because encoding keyword has been removed from python3.9:
https://docs.python.org/3/library/json.html#json.loads

This problem is already solved on new dataclasses_json versions. So, changing the version for this in pyproject.toml and also updating the rest of dependencies should do the trick.

Version with this fixed:
dataclasses-json = "^0.5.2"

@DeastinY
Copy link

That fixed it for me, thanks!

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

No branches or pull requests

2 participants