-
Notifications
You must be signed in to change notification settings - Fork 728
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
googletrans 4.0.0-rc1 fails with TypeError: 'NoneType' object is not iterable on client.py:222 #260
Comments
I'm getting a similar issue, it seems whenever Google gives two results it fails. [['wrb.fr', 'MkEWBc', '[[null,null,null,[[[0,[[[null,3]\n]\n,[true]\n]\n]\n,[2,[[[null,4]\n,[4,24]\n]\n,[false,true]\n]\n]\n]\n,24]\n]\n,[[[null,"\nPhraxāthity̒ kảlạng ca tkdin",null,null,null,[[null,[""]\n]\n,["\n"]\n,["พระอาทิตย์กำลังจะตกดิน",["พระอาทิตย์กำลังจะตกดิน","ดวงอาทิตย์เป็นเรื่องเกี่ยวกับชุด"]\n]\n]\n]\n]\n,"th",1,"en"]\n]\n', None, None, None, 'generic'], ['di', 63], ['af.httprm', 63, '-9129644094679872904', 37]] |
@noaho Thanks for giving me the raw response. I'll fix it within a few days. |
Thank you for the great project 😊 |
Hello! I have the same problem too. |
Hi! any solution for this problem? |
@ahmedbr I'm still working on it. Give me a little time please. |
Thank you so much for your efforts bro, I've just faced the problem and wanted to ask whether it's been solved. Thanks again. 😄 |
I think I have the solution. Replace this line 222 of googletrans/client.py with this
Gender-specific translations now work.
(This is my first comment on github, I don't know how to put this code snippet in your pull request) |
Thanks for your reply, but this doesn't work for me |
Use this for google translation and it is working fine Thank me later |
Hi, Still any solution to this issue? |
@mr2rm You are more than welcome to work on this :) |
@kidburglar |
Same error here, it seems the issue still exsits. |
I will try to find few case where I can reproduct the issue. I noted that it was because the gender like you said but also if you got an URL the answer from google is not the same. |
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. |
incorrect from en to fr gives this error |
Actual code to reproduce
The code from the first post still crashes
|
Still an issue. Any gendered word causes this. Another example: translator.translate("white", src="en", dest="es") |
I still have this problem when running the code like this: However, when I take out the |
|
No one ever updated this thread, so I discovered this from stackoverflow, but this issue has already been solved. |
The version googletrans==3.1.0a0 has this problem too . |
Still an issue. Other examples: translator.translate('ALPINE', src='en', dest='es') |
I don`t know if someone explains here what is the source of this problem. I mapped that it happens when the translation returns two or more options. An example is the word "Automatic". When this word is translated for Portuguese without context can return two options, "Automático" or "Automática". I think that you can create a parameter to define which genre the code needs to return male or female. |
Was there any solution to this error, other than the |
@MFRS Thank you - worked perfectly! |
@MFRS This work for me, be sure to restart session if you are running on colab |
Googletrans version:
I'm submitting a ...
Current behavior:
Expected behavior:
I expect the "Author" word in deuch
Steps to reproduce:
The text was updated successfully, but these errors were encountered: