Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "TypeError: 'NoneType' object is not iterable" when translating word "stripper" #278

Closed
dominikpegler opened this issue Feb 24, 2021 · 8 comments

Comments

@dominikpegler
Copy link

dominikpegler commented Feb 24, 2021

  • Googletrans version: 4.0.0rc1
  • OS: Ubuntu, Win10

Current behavior:
When translating the word "stripper" from English to German or to French this error occurs. Translation of the same word to other languages such as Spanish, Russian, Romanian or Italian works.

>>> translator = Translator(service_urls=['translate.google.com','translate.google.at'])
>>> translator.translate("Stripper",src="en",dest="fr").text
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Pegler\Miniconda3\lib\site-packages\googletrans\client.py", line 222, in translate
    translated_parts = list(map(lambda part: TranslatedPart(part[0], part[1] if len(part) >= 2 else []), parsed[1][0][0][5]))
TypeError: 'NoneType' object is not iterable
@terryyz
Copy link
Collaborator

terryyz commented Mar 10, 2021

Hi @donkndetphone, there's a bug of getting the useful information inside parsed variable in the client.py. I'm trying to fix this.

@Aguiar16
Copy link

Aguiar16 commented May 6, 2021

i get the same error when trying to translate the word "right" from english to portuguese

@pbtsrc
Copy link

pbtsrc commented Jun 3, 2021

The same for
translator.translate('German', src='en', dest='es')

@stale
Copy link

stale bot commented Aug 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 2, 2021
@benjaminvanrenterghem
Copy link

benjaminvanrenterghem commented Aug 4, 2021

Translating "Miscellaneous" to lang=es triggers the same error (version 4.0.0rc1)

@stale stale bot removed the wontfix label Aug 4, 2021
@benjaminvanrenterghem
Copy link

image
image
image

This seems to be the cause, when it gives back a feminine and masculine form of the word when performed manually.

@stale
Copy link

stale bot commented Oct 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 3, 2021
@stale stale bot closed this as completed Oct 11, 2021
@sachin-suresh-rapyuta
Copy link

For anyone who is still facing the issue, I had to use the try block as discussed in this thread. It seems to be working for me after adding the try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants