-1

I was using VSCode to write Python code. When running the code in debug mode it gives the following error:

Extra data: line 1 column 390 (char 389) File "---" line 20, in translated_text = translator.translate(speech_text, lang_tgt = 'fr')

Some code that runs the same issue can be seen here.

The line in question is the following: translated_text = translator.translate(speech_text, lang_tgt = 'fr')

I have imported the library into VS Code and am using the right Python version. Does anyone know a fix to this error? Has the documentation changed?

Coolbro83
  • 29
  • 4
  • 2
    Please go through https://stackoverflow.com/help/minimal-reproducible-example and provide required code for debugging/fixing. – High-Octane Apr 23 '22 at 17:56

1 Answers1

1

Looks like you have run across the issue on GitHub of google_trans_new, this is the workaround:

Change the line 151 in google_trans_new/google_trans_new.py which is: response = (decoded_line + ']') to response = decoded_line

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13