You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been experiencing the following error: File "/usr/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 499 (char 498)
within the translate function of google_translator class.
I found a solution that works for me that is skipping the first line where the error occurs and adds a ']' and directly go with the decoded_line so that:
`[...]
if "MkEWBc" in decoded_line:
try:
response = json.loads(decoded_line)
response = list(response)
response = json.loads(response[0][2])
response_ = list(response)
response = response_[1][0]
[...]`
Is this solution for the bug valid?
Many thanks!
The text was updated successfully, but these errors were encountered:
Hi!
I've been experiencing the following error:
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 499 (char 498)
raised by:
response = (decoded_line + ']')
response = json.loads(response)
within the translate function of google_translator class.
I found a solution that works for me that is skipping the first line where the error occurs and adds a ']' and directly go with the decoded_line so that:
`[...]
if "MkEWBc" in decoded_line:
try:
response = json.loads(decoded_line)
response = list(response)
response = json.loads(response[0][2])
response_ = list(response)
response = response_[1][0]
[...]`
Is this solution for the bug valid?
Many thanks!
The text was updated successfully, but these errors were encountered: