This repository was archived by the owner on Jan 18, 2025. It is now read-only.
Fixing JSON key service account assertions in Python3.#126
Merged
craigcitro merged 1 commit intogoogleapis:masterfrom Feb 6, 2015
Merged
Fixing JSON key service account assertions in Python3.#126craigcitro merged 1 commit intogoogleapis:masterfrom
craigcitro merged 1 commit intogoogleapis:masterfrom
Conversation
Fixes googleapis#125. NOTE: '%s.%s' does not behave the same between versions and should be removed throughout this library. I will be following this up with a set of regression tests (hopefully some of which will fail) and we can assess the damage of other uses of '%s'.
Contributor
Author
|
To verify: from __future__ import print_function
from oauth2client import client
import httplib2
SEPARATOR = '=' * 60
SCOPES = ('https://www.googleapis.com/auth/userinfo.email',)
CREDENTIALS_FILENAME = '/path/to/credentials.json'
CREDENTIALS = client._get_application_default_credential_from_file(
CREDENTIALS_FILENAME).create_scoped(SCOPES)
print('oauth2client.client.__file__ (make sure this is local):')
print(repr(client.__file__))
print(SEPARATOR)
print('CREDENTIALS.refresh_token before:')
print(repr(CREDENTIALS.refresh_token))
print('CREDENTIALS.access_token before:')
print(repr(CREDENTIALS.access_token))
print(SEPARATOR)
HTTP = httplib2.Http()
result = CREDENTIALS.refresh(HTTP)
print('refresh result:')
print(repr(result))
print(SEPARATOR)
print('CREDENTIALS.refresh_token after:')
print(repr(CREDENTIALS.refresh_token))
print('CREDENTIALS.access_token after:')
print(repr(CREDENTIALS.access_token)) |
Contributor
Author
|
For me this results in outputs Python 2Python 3 |
Contributor
Author
|
@craigcitro PTAL |
craigcitro
added a commit
that referenced
this pull request
Feb 6, 2015
Fixing JSON key service account assertions in Python3.
Contributor
Author
|
w00t. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #125.
NOTE:
'%s.%s'does not behave the same between versions and should be removed throughout this library.I will be following this up with a set of regression tests (hopefully some of which will fail) and we can assess the damage of other uses of
'%s'.