Language Translator app is throwing up an error regarding JSONDecode

Hello all,

A few days ago, I deployed a Language Translator app.
The Language Translator app was going fine those days. When I checked this morning, It is showing a json.JSONDecode error.

ERROR:

json.decoder.JSONDecodeError: Extra data: line 1 column 798 (char 797)
Uncaught app exception
Traceback (most recent call last):
File “/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py”, line 338, in _run_script
exec(code, module.dict)
File “/app/languagetranslator/main.py”, line 35, in
translate = translator.translate(text,lang_src=value1,lang_tgt=value2)
File “/home/appuser/venv/lib/python3.7/site-packages/google_trans_new/google_trans_new.py”, line 188, in translate
raise e
File “/home/appuser/venv/lib/python3.7/site-packages/google_trans_new/google_trans_new.py”, line 152, in translate
response = json.loads(response)
File “/usr/local/lib/python3.7/json/init.py”, line 348, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.7/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)

Github repo: GitHub - HarisankarSNair/LanguageTranslator: A web app for translating from one language to another.Almost all languages are available.App also generates an audio file of the translation and lets you download the audio file.

Live App: https://share.streamlit.io/harisankarsnair/languagetranslator/main/main.py

I don’t know why this JSON error is being shown up suddenly.
Can anyone help me solve this problem?
Any help will be much appreciated.

Regards,
Harisankar.

Hey @HarisankarSNair,

Were you able to figure this out? It seems your app is up now and not displaying that JSON error.

Happy Streamlit-ing!
Marisa

1 Like