{"push_id":2747805359,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"efe335abc8e3254fad78b5cf68f2a511e7345a7b","before":"d6c3cef5f62615f09c5ca17afcfb29886beed2aa","commits":[{"sha":"efe335abc8e3254fad78b5cf68f2a511e7345a7b","author":{"name":"Jason Moiron","email":"d8f1ced0c0cb803649d35b94a18e526c28c8caf4@jmoiron.net"},"message":"fix python3 json lib error in oauth2_helper.py\n\nWhen using this as a python module from python3 and providing it with a key file, it reads with 'rb', which causes python3 json library to choke:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"./repl.py\", line 23, in <module>\r\n  elif token_cache_type == 'in_memory':\r\n    connection = boto.connect_s3(provider='google', host='storage.googleapis.com')\r\n  File \"/usr/local/lib/python3.5/dist-packages/boto/__init__.py\", line 141, in connect_s3\r\n    return S3Connection(aws_access_key_id, aws_secret_access_key, **kwargs)\r\n  File \"/usr/local/lib/python3.5/dist-packages/boto/s3/connection.py\", line 194, in __init__\r\n    validate_certs=validate_certs, profile_name=profile_name)\r\n  File \"/usr/local/lib/python3.5/dist-packages/boto/connection.py\", line 569, in __init__\r\n    host, config, self.provider, self._required_auth_capability())\r\n  File \"/usr/local/lib/python3.5/dist-packages/boto/auth.py\", line 1011, in get_auth_handler\r\n    ready_handlers.append(handler(host, config, provider))\r\n  File \"/usr/local/lib/python3.5/dist-packages/gcs_oauth2_boto_plugin/oauth2_plugin.py\", line 56, in __init__\r\n    config, cred_type=oauth2_client.CredTypes.OAUTH2_SERVICE_ACCOUNT)\r\n  File \"/usr/local/lib/python3.5/dist-packages/gcs_oauth2_boto_plugin/oauth2_helper.py\", line 85, in OAuth2ClientFromBotoConfig\r\n    json_key_dict = json.loads(private_key)\r\n  File \"/usr/lib/python3.5/json/__init__.py\", line 312, in loads\r\n    s.__class__.__name__))\r\nTypeError: the JSON object must be str, not 'bytes'\r\n```\r\nThere are two potential fixes;  read with 'r' instead of 'rb', or decode the bytes into a string for json.  I chose the latter, in case the fallback file format requires the bytes, but I did not test with the fallback format.","distinct":true,"url":"https://api.github.com/repos/jmoiron/gcs-oauth2-boto-plugin/commits/efe335abc8e3254fad78b5cf68f2a511e7345a7b"}]}
{"actor":{"display_login":"jmoiron"}}