-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Ensuring response from httplib2 is treated as str in Python 2 and bytes in Python3 #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensuring response from httplib2 is treated as str in Python 2 and bytes in Python3 #724
Conversation
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…nnection.api_request is decoded to a string before being passed to json.loads
…o use six.binary_type
…intention clearer
a66cb5c to
62e13d7
Compare
- Incorporates changes from googleapis#724. - Also requires httplib2 from HEAD since the bytes/unicode header issues have not been released on PyPI yet.
- Incorporates changes from googleapis#724. - Also requires httplib2 from HEAD since the bytes/unicode header issues have not been released on PyPI yet.
|
@craigloftus Thanks for doing this work. I have incorporated it into #756 to keep this from bit-rotting too much as we make more updates to master. Please re-open or comment if you have any issues with this. |
|
@dhermes No worries. I learnt a lot and look forward to no longer depending on my fork. |
…724) Source-Link: googleapis/synthtool@280ddae Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:346ab2efb51649c5dde7756cbbdc60dd394852ba83b9bbffc292a63549f33c17 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…724) Source-Link: googleapis/synthtool@280ddae Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:346ab2efb51649c5dde7756cbbdc60dd394852ba83b9bbffc292a63549f33c17 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* feat: implement `OperationsRestAsyncTransport` to support long running operations (#700) * feat: Add OperationsRestAsyncTransport to support long running operations * update TODO comment * update TODO comment * address feedback * address feedback * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix mypy and lint issues * minor fix * add no cover * fix no cover tag * link coverage issue * silence coverage issue * fix statement name error * address PR feedback * address PR feedback * address PR comments --------- Co-authored-by: ohmayr <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> * feat: implement async client for LROs (#707) * feat: implement `AbstractOperationsAsyncClient` to support long running operations * remove coverage guards * address presubmit failures * fix coverage for cancel operation * tests cleanup * fix incorrect tests * file bugs * add auth import * address PR comments * address PR comments * fix unit tests and address more comments * disable retry parameter * add retry parameter * address PR comments --------- Co-authored-by: ohmayr <[email protected]> Co-authored-by: ohmayr <[email protected]> * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Anthonios Partheniou <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: add CreateDatabase API PiperOrigin-RevId: 537397252 Source-Link: googleapis/googleapis@b4481e1 Source-Link: googleapis/googleapis-gen@6b4b12a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmI0YjEyYWJlOWVjZTYzODJlYThkNmZmZDVjNTBlMzZiMzI5MDVmOCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
``` codespell --version 2.1.0 ```
When using Python 3
httplib2returns response content asbytes, but the content isstrin Python 2. This causes problems when passing the content tojson.loads, which requiresstralways.Tests were passing previously because they were mocking the response by
httplib2as astr. These tests have been changed to use thebnotation, which resolves tostrin Python 2 andbytesin Python 3.This is the follow-up from PR #697.