-
Notifications
You must be signed in to change notification settings - Fork 5.7k
ValueError: No JSON object could be decoded #63
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
Comments
Uhm, this is probably the Bad Gateway error (HTTP 504), but because parse I'll patch it up and bump this thread again once released.
|
@leandrotoledo But, to confirm, would you mind to add print (json_data) right after raise TelegramError on yours request.py? |
Not sure I mentioned my self, but it was for you @pkikui |
Handles HTTP Bad Gateway error (503) on request module #63
Released on v2.8.5, please update to latest version. |
I get crashes every once in awhile with the newest version:
ERROR:root:main loop:
Traceback (most recent call last):
File "./telegram-bot.py", line 485, in main
exit = parse(bot)
File "./telegram-bot.py", line 516, in parse
for update in bot.getUpdates(offset=LAST_UPDATE_ID, timeout=10):
File "/usr/local/lib/python2.7/site-packages/telegram/bot.py", line 123, in decorator
result = func(self, _args, *_kwargs)
File "/usr/local/lib/python2.7/site-packages/telegram/bot.py", line 653, in getUpdates
result = request.post(url, data)
File "/usr/local/lib/python2.7/site-packages/telegram/utils/request.py", line 96, in post
message = _parse(error.read())
File "/usr/local/lib/python2.7/site-packages/telegram/utils/request.py", line 45, in _parse
data = json.loads(json_data.decode())
File "/usr/local/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
The text was updated successfully, but these errors were encountered: