terryyin / translate-python

Online translation as a Python module & command line tool. No key, no authentication needed.
MIT License
728 stars 153 forks source link

Attempted use of cli returns error #93

Open jaded0 opened 2 years ago

jaded0 commented 2 years ago
Traceback (most recent call last):
  File "/home/jaden/.local/lib/python3.8/site-packages/translate/translate.py", line 45, in <genexpr>
    return ' '.join(self.provider.get_translation(text_wraped) for text_wraped in text_list)
  File "/home/jaden/.local/lib/python3.8/site-packages/translate/providers/mymemory_translated.py", line 49, in get_translation
    next_best_match = next(match for match in matches)
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jaden/.local/bin/translate-cli", line 5, in <module>
    from translate.__main__ import cli
  File "/home/jaden/.local/lib/python3.8/site-packages/translate/__main__.py", line 6, in <module>
    main()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jaden/.local/lib/python3.8/site-packages/translate/main.py", line 168, in main
    translation = translator.translate(text)
  File "/home/jaden/.local/lib/python3.8/site-packages/translate/translate.py", line 45, in translate
    return ' '.join(self.provider.get_translation(text_wraped) for text_wraped in text_list)
RuntimeError: generator raised StopIteration