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

Silence oauth2client tracebacks when using Google Cloud Speech API #229

Merged
merged 1 commit into from
May 6, 2017

Conversation

akabraham
Copy link
Contributor

If you're using the latest version of google-api-python-client (1.6.2) which uses oauth2client 4.0.0, then you will see these tracebacks on every call to recognize_google_cloud()

2017-04-26 01:09:47,839 WARNING -- __init__.py:44 -- file_cache is unavailable when using oauth2client >= 4.0.0
Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/v/lib/python3.4/site-packages/googleapiclient/discovery_
cache/__init__.py", line 36, in autodetect
    from google.appengine.api import memcache
ImportError: No module named 'google'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/v/lib/python3.4/site-packages/googleapiclient/discovery_
cache/file_cache.py", line 33, in <module>
    from oauth2client.contrib.locked_file import LockedFile
ImportError: No module named 'oauth2client.contrib.locked_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/v/lib/python3.4/site-packages/googleapiclient/discovery_
cache/file_cache.py", line 37, in <module>
    from oauth2client.locked_file import LockedFile
ImportError: No module named 'oauth2client.locked_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.virtualenvs/v/lib/python3.4/site-packages/googleapiclient/discovery_
cache/__init__.py", line 41, in autodetect
    from . import file_cache
  File "/home/ubuntu/.virtualenvs/v/lib/python3.4/site-packages/googleapiclient/discovery_
cache/file_cache.py", line 41, in <module>
    'file_cache is unavailable when using oauth2client >= 4.0.0')
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0

This is a known issue on Google's end. There was a suggested fix from googleapis/google-api-python-client#299 that I've applied here. No more tracebacks as a result!

@Uberi
Copy link
Owner

Uberi commented May 6, 2017

Thanks for the patch and write-up, @akabraham!

@Uberi Uberi merged commit 6a1ec0d into Uberi:master May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants