aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2018-06-06 10:31:45 +0200
committerGravatar Jan Tattermusch <jtattermusch@google.com>2018-11-21 13:08:30 +0100
commit95bae1ead938dfade8b120350a79b3cbebb7e797 (patch)
tree98e02e4dd06540a81b44e104cb3e3a837369cff2
parent5a0f72259072c1ff0002126de0fb4b8fa4f33329 (diff)
make client_email loading python3 compatible
-rw-r--r--src/python/grpcio_tests/tests/interop/methods.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/python/grpcio_tests/tests/interop/methods.py b/src/python/grpcio_tests/tests/interop/methods.py
index 721dedf0b7..d0a9c7aaf0 100644
--- a/src/python/grpcio_tests/tests/interop/methods.py
+++ b/src/python/grpcio_tests/tests/interop/methods.py
@@ -422,7 +422,7 @@ def _compute_engine_creds(stub, args):
def _oauth2_auth_token(stub, args):
json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
- wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
+ wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
response = _large_unary_common_behavior(stub, True, True, None)
if wanted_email != response.username:
raise ValueError('expected username %s, got %s' % (wanted_email,
@@ -435,7 +435,7 @@ def _oauth2_auth_token(stub, args):
def _jwt_token_creds(stub, args):
json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
- wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
+ wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
response = _large_unary_common_behavior(stub, True, False, None)
if wanted_email != response.username:
raise ValueError('expected username %s, got %s' % (wanted_email,
@@ -444,7 +444,7 @@ def _jwt_token_creds(stub, args):
def _per_rpc_creds(stub, args):
json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
- wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
+ wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
call_credentials = grpc.metadata_call_credentials(