Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

aki session sometimes ends with json.decoder.JSONDecodeError #28

Closed
owocado opened this issue Jan 31, 2021 · 1 comment
Closed

aki session sometimes ends with json.decoder.JSONDecodeError #28

owocado opened this issue Jan 31, 2021 · 1 comment

Comments

@owocado
Copy link

owocado commented Jan 31, 2021

Hi,

aki session sometimes ends with said error as title says:
Here is the full traceback:

Traceback (most recent call last):

  File "/opt/lib/python3.9/site-packages/redbot/vendored/discord/ext/menus/__init__.py", line 638, in update
    await button(self, payload)
  File "/opt/cogs/CogManager/cogs/aki/aki.py", line 34, in no
    await self.aki.answer("no")
  File "/opt/lib/python3.9/site-packages/akinator/async_aki/async_akinator.py", line 189, in answer
    resp = self._parse_response(await w.text())
  File "/opt/lib/python3.9/site-packages/akinator/async_aki/async_akinator.py", line 88, in _parse_response
    return json.loads(",".join(response.split("(")[1::])[:-1])
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I have a feeling this is an issue with upstream library but unsure so here's an issue.

@phenom4n4n
Copy link
Owner

This is an issue with the akinator library that I'm not sure will be fixed. I've pushed a catch for it that will explain the game errored out.

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