{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2577","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2577/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2577/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2577/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2577","id":184294532,"number":2577,"title":"pubsub messages are twice base64 encoded when using GAX","user":{"login":"ericbuehl","id":715650,"avatar_url":"https://avatars.githubusercontent.com/u/715650?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbuehl","html_url":"https://github.com/ericbuehl","followers_url":"https://api.github.com/users/ericbuehl/followers","following_url":"https://api.github.com/users/ericbuehl/following{/other_user}","gists_url":"https://api.github.com/users/ericbuehl/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbuehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbuehl/subscriptions","organizations_url":"https://api.github.com/users/ericbuehl/orgs","repos_url":"https://api.github.com/users/ericbuehl/repos","events_url":"https://api.github.com/users/ericbuehl/events{/privacy}","received_events_url":"https://api.github.com/users/ericbuehl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels/pubsub","name":"pubsub","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-10-20T17:41:35Z","updated_at":"2016-10-24T16:28:59Z","closed_at":"2016-10-24T16:14:47Z","body":"I am using a recent master (85a0c1a)\r\n```\r\nPython 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16) \r\n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\n$ pip show google-cloud-pubsub\r\n---\r\nMetadata-Version: 2.0\r\nName: google-cloud-pubsub\r\nVersion: 0.20.0+85a0c1a\r\nSummary: Python Client for Google Cloud Pub/Sub\r\nHome-page: https://github.com/GoogleCloudPlatform/google-cloud-python\r\nAuthor: Google Cloud Platform\r\nAuthor-email: jjg+google-cloud-python@google.com\r\nInstaller: pip\r\nLicense: Apache 2.0\r\nLocation: /Users/eric/env/lib/python2.7/site-packages\r\nRequires: google-cloud-core, grpc-google-pubsub-v1, gapic-google-pubsub-v1, grpcio, google-gax\r\nClassifiers:\r\n  Development Status :: 4 - Beta\r\n  Intended Audience :: Developers\r\n  License :: OSI Approved :: Apache Software License\r\n  Operating System :: OS Independent\r\n  Programming Language :: Python :: 2\r\n  Programming Language :: Python :: 2.7\r\n  Programming Language :: Python :: 3\r\n  Programming Language :: Python :: 3.4\r\n  Programming Language :: Python :: 3.5\r\n  Topic :: Internet\r\n```\r\n---\r\nTo demonstrate this issue, I set up a simple pubsub push endpoint that prints the posted data.\r\n\r\n```\r\n$ python\r\n>>> from google.cloud import pubsub\r\n>>> pubsub.Client(\"myproject\").topic(\"mytopic\").publish(\"blah\")\r\n```\r\n\r\nData received at push endpoint:\r\n```\r\n{u'message': {u'attributes': {},\r\n              u'data': u'WW14aGFBPT0=',\r\n...\r\n```\r\n---\r\n```\r\n$ GOOGLE_CLOUD_DISABLE_GRPC=1 python\r\n>>> from google.cloud import pubsub\r\n>>> pubsub.Client(\"myproject\").topic(\"mytopic\").publish(\"blah\")\r\n```\r\n\r\nData received at push endpoint:\r\n```\r\n{u'message': {u'attributes': {},\r\n              u'data': u'YmxhaA==',\r\n...\r\n```\r\n\r\nAs you can see, the data in the first version is a twice-encoded version of the message \"blah\" while GAX is in use.  I would expect to see the latter regardless of GAX being enabled or not.\r\n\r\n-----\r\n\r\n(Added by @dhermes)\r\n\r\n```python\r\n>>> import base64\r\n>>> base64.b64decode(u'WW14aGFBPT0=')\r\n'YmxhaA=='\r\n>>> base64.b64decode('YmxhaA==')\r\n'blah'\r\n```"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/comments/255791937","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2577#issuecomment-255791937","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2577","id":255791937,"user":{"login":"Fkawala","id":1567274,"avatar_url":"https://avatars.githubusercontent.com/u/1567274?v=3","gravatar_id":"","url":"https://api.github.com/users/Fkawala","html_url":"https://github.com/Fkawala","followers_url":"https://api.github.com/users/Fkawala/followers","following_url":"https://api.github.com/users/Fkawala/following{/other_user}","gists_url":"https://api.github.com/users/Fkawala/gists{/gist_id}","starred_url":"https://api.github.com/users/Fkawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fkawala/subscriptions","organizations_url":"https://api.github.com/users/Fkawala/orgs","repos_url":"https://api.github.com/users/Fkawala/repos","events_url":"https://api.github.com/users/Fkawala/events{/privacy}","received_events_url":"https://api.github.com/users/Fkawala/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T16:28:59Z","updated_at":"2016-10-24T16:28:59Z","body":"@daspecster Thanks for this blazing fast fix ! \r\n@dhermes Either way, a release would be greatly appreciated over here.  "}}
{"actor":{"display_login":"Fkawala"}}