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

Could it be that AttributeError: 'NoneType' object has no attribute 'group' is back as an issue? #235

Closed
2 of 3 tasks
bastienboutonnet opened this issue Nov 2, 2020 · 2 comments

Comments

@bastienboutonnet
Copy link

bastienboutonnet commented Nov 2, 2020

Googletrans version:

  • **3.0.0

I'm submitting a ...

  • bug report
  • feature request

Current behavior:

Getting the following error intermittently.

  File "<truncated_for_privacy>/lib/python3.6/site-packages/googletrans/client.py", line 182, in translate
    data = self._translate(text, dest, src, kwargs)
  File "<truncated_for_privacy>/lib/python3.6/site-packages/googletrans/client.py", line 78, in _translate
    token = self.token_acquirer.do(text)
  File "<truncated_for_privacy>/lib/python3.6/site-packages/googletrans/gtoken.py", line 194, in do
    self._update()
  File "<truncated_for_privacy>/lib/python3.6/site-packages/googletrans/gtoken.py", line 62, in _update
    code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'

Expected behavior:

According to #48 this should have been fixed.

Steps to reproduce:

This issue isn't easy to reproduce and comes on and off. I'm applying translation over a pandas.DataFrame using the following:
df[text_column].fillna("").apply(lambda text: translator.translate(text, dest="en"))

Other information:

I checked issues and PRs related to #48 Looks like the issue is coming back judging by this recent comment: #48 (comment)

@ssut
Copy link
Owner

ssut commented Nov 2, 2020

I am going to close this in favor of #234. Thanks for taking the time to report this.

@ssut ssut closed this as completed Nov 2, 2020
@suciokhan
Copy link

I'm experiencing similar problems:

File "/home/suciokhan/clear_prospect/orcid_grakn_prep/puller.py", line 517, in name_translator translations = translator.translate(name_list, dest='en') File "/home/suciokhan/anaconda3/lib/python3.8/site-packages/googletrans/client.py", line 177, in translate translated = self.translate(item, dest=dest, src=src, **kwargs) File "/home/suciokhan/anaconda3/lib/python3.8/site-packages/googletrans/client.py", line 182, in translate data = self._translate(text, dest, src, kwargs) File "/home/suciokhan/anaconda3/lib/python3.8/site-packages/googletrans/client.py", line 78, in _translate token = self.token_acquirer.do(text) File "/home/suciokhan/anaconda3/lib/python3.8/site-packages/googletrans/gtoken.py", line 194, in do self._update() File "/home/suciokhan/anaconda3/lib/python3.8/site-packages/googletrans/gtoken.py", line 62, in _update code = self.RE_TKK.search(r.text).group(1).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group'

Repository owner locked and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants