Refresh empty OAuth2 credentials in batch request

Batch request serialization requires the credentials in the http
object to be applied to every individual request *prior* to
actually invoking http.request(). This circumvents the self-refresh
logic in the request() function monkey-patched by the OAuth2
credentials, thus resulting in the use of an uninitialized credentials
object.

The fix here is to detect when OAuth2-like credentials are being
used and to force a refresh in case the access token is not
initialized yet.

Resolves: #211
2 files changed
tree: 01d5fdf972445958fb3a52c7233bed64b5337999
  1. apiclient/
  2. docs/
  3. googleapiclient/
  4. samples/
  5. static/
  6. tests/
  7. tools/
  8. .coveragerc
  9. .gitignore
  10. .gitmodules
  11. .hgignore
  12. .travis.yml
  13. CHANGELOG
  14. describe.py
  15. expandsymlinks.py
  16. LICENSE
  17. Makefile
  18. MANIFEST.in
  19. README.md
  20. samples-index.py
  21. setup.py
  22. sitecustomize.py
  23. tox.ini
README.md

About

This is the Python client library for Google's discovery based APIs. To get started, please see the full documentation for this library. Additionally, dynamically generated documentation is available for all of the APIs supported by this library.

Installation

To install, simply use pip or easy_install:

$ pip install --upgrade google-api-python-client

or

$ easy_install --upgrade google-api-python-client

See the Developers Guide for more detailed instructions and additional documentation.

Python Version

Python 2.6 or 2.7 are fully supported.

Python 3.3+ is also now supported! However, this library has not yet been used as thoroughly with Python 3, so we'd recommend testing before deploying with Python 3 in production.

Third Party Libraries and Dependencies

The following libraries will be installed when you install the client library:

For development you will also need the following libraries:

Contributing

Please see the contributing page for more information. In particular, we love pull requests - but please make sure to sign the contributor license agreement.