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(decodedline)
response = list(response)
response = json.loads(response[0][2])
response = list(response)
response = response_[1][0]
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(decodedline) 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!