GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Ensuring response from httplib2 is treated as str in Python 2 and bytes in Python3 by craigloftus · Pull Request #724 · googleapis/google-cloud-python

Conversation

@craigloftus

@craigloftus craigloftus commented Mar 13, 2015

Copy link
Copy Markdown

When using Python 3 httplib2 returns response content as bytes, but the content is str in Python 2. This causes problems when passing the content to json.loads, which requires str always.

Tests were passing previously because they were mocking the response by httplib2 as a str. These tests have been changed to use the b notation, which resolves to str in Python 2 and bytes in Python 3.

This is the follow-up from PR #697.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 13, 2015
@coveralls

coveralls commented Mar 13, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling a66cb5c on craigloftus:python3_support_improvements into d9e2156 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver
tseaver reviewed Mar 13, 2015
View reviewed changes
Comment thread gcloud/storage/connection.py

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

craigloftus added 5 commits March 16, 2015 09:42
@craigloftus
Ensuring content returned by httplib2 in gcloud.storage.connection.Co…
bc78d84
…nnection.api_request is decoded to a string before being passed to json.loads
@craigloftus
Changing responses from Http mock in gcloud.storage.test_connection t…
d886eca
…o use six.binary_type
@craigloftus
Make exceptions work in Python 2 and 3
1720e80
@craigloftus
Refactoring make_exception to remove unused code and try to make the …
1d6c29c
…intention clearer
@craigloftus
Making use of encode use utf-8 explicitly
62e13d7
@craigloftus
craigloftus force-pushed the python3_support_improvements branch from a66cb5c to 62e13d7 Compare March 16, 2015 09:55
@craigloftus
Fixing new tests and linting issue
68fa37f
@coveralls

coveralls commented Mar 16, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 68fa37f on craigloftus:python3_support_improvements into d668044 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@craigloftus
Adding explicit check for binary_type in gcloud.storage.connection.ap…
4785d98
…i_request
@coveralls

coveralls commented Mar 16, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 4785d98 on craigloftus:python3_support_improvements into d668044 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Mar 24, 2015

Copy link
Copy Markdown
Contributor

@tseaver I am working on integrating this (and getting regression3 to pass)

Spurred on by #755 and #754

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dhermes added a commit to dhermes/google-cloud-python that referenced this pull request Mar 24, 2015
@dhermes
Making regression3 pass by using bytes / unicode correctly.
d7979ac
- Incorporates changes from googleapis#724.
- Also requires httplib2 from HEAD since the bytes/unicode
  header issues have not been released on PyPI yet.
dhermes added a commit to dhermes/google-cloud-python that referenced this pull request Mar 24, 2015
@dhermes
Making regression3 pass by using bytes / unicode correctly.
11904c3
- Incorporates changes from googleapis#724.
- Also requires httplib2 from HEAD since the bytes/unicode
  header issues have not been released on PyPI yet.
@dhermes dhermes mentioned this pull request Mar 24, 2015
Making regression3 pass #756
Merged
@dhermes

dhermes commented Mar 24, 2015

Copy link
Copy Markdown
Contributor

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes dhermes closed this Mar 24, 2015
@craigloftus

craigloftus commented Mar 24, 2015

Copy link
Copy Markdown
Author

@dhermes No worries. I learnt a lot and look forward to no longer depending on my fork.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

parthea pushed a commit that referenced this pull request Aug 21, 2025
@gcf-owl-bot
build: update actions/upload-artifact and actions/download-artifact (#…
da197e5
…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>
parthea pushed a commit that referenced this pull request Sep 16, 2025
@gcf-owl-bot @parthea
build: update actions/upload-artifact and actions/download-artifact (#…
87df524
…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>
parthea pushed a commit that referenced this pull request Nov 22, 2025
@renovate-bot
chore(deps): update dependency pytest to v7.2.1 (#724)
b394b2b
parthea pushed a commit that referenced this pull request Nov 24, 2025
@release-please
chore: release 0.39.1 (#724)
032599f
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Nov 24, 2025
@ohmayr @parthea @gcf-owl-bot
feat: add support for asynchronous long running operations (#724)
b8ae912
* 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>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@gcf-owl-bot
feat: add CreateDatabase API (#724)
ea259b9
* 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>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@renovate-bot
chore(deps): update dependency google-cloud-pubsub to v2.14.1 (#724)
bbdf375
parthea pushed a commit that referenced this pull request Nov 24, 2025
@schwehr
chore: fix docstring typos (found via codespell) (#724)
e503de8
```
codespell --version
2.1.0
```
parthea pushed a commit that referenced this pull request Nov 25, 2025
@renovate-bot
chore(deps): update dependency google-cloud-pubsub to v2.14.1 (#724)
b679ae1
parthea pushed a commit that referenced this pull request Mar 6, 2026
@plamut
feat: add support for user defined Table View Functions (#724)
2e6268d
* Add auxiliary classes for TVF routines

* Add return_table_type property to Routine

* Add system test for TVF routines

* Use the generated StandardSqlTableType class

* Update docs with new changes

* Add missing space in misc. Sphinx directives
parthea pushed a commit that referenced this pull request Mar 6, 2026
@release-please
chore: release 2.22.0 (#771)
ff79006
🤖 I have created a release \*beep\* \*boop\*
---
## [2.22.0](https://www.github.com/googleapis/python-bigquery/compare/v2.21.0...v2.22.0) (2021-07-19)


### Features

* add `LoadJobConfig.projection_fields` to select DATASTORE_BACKUP fields ([#736](https://www.github.com/googleapis/python-bigquery/issues/736)) ([c45a738](https://www.github.com/googleapis/python-bigquery/commit/c45a7380871af3dfbd3c45524cb606c60e1a01d1))
* add standard sql table type, update scalar type enums ([#777](https://www.github.com/googleapis/python-bigquery/issues/777)) ([b8b5433](https://www.github.com/googleapis/python-bigquery/commit/b8b5433898ec881f8da1303614780a660d94733a))
* add support for more detailed DML stats ([#758](https://www.github.com/googleapis/python-bigquery/issues/758)) ([36fe86f](https://www.github.com/googleapis/python-bigquery/commit/36fe86f41c1a8f46167284f752a6d6bbf886a04b))
* add support for user defined Table View Functions ([#724](https://www.github.com/googleapis/python-bigquery/issues/724)) ([8c7b839](https://www.github.com/googleapis/python-bigquery/commit/8c7b839a6ac1491c1c3b6b0e8755f4b70ed72ee3))


### Bug Fixes

* avoid possible job already exists error ([#751](https://www.github.com/googleapis/python-bigquery/issues/751)) ([45b9308](https://www.github.com/googleapis/python-bigquery/commit/45b93089f5398740413104285cc8acfd5ebc9c08))


### Dependencies

* allow 2.x versions of `google-api-core`, `google-cloud-core`, `google-resumable-media` ([#770](https://www.github.com/googleapis/python-bigquery/issues/770)) ([87a09fa](https://www.github.com/googleapis/python-bigquery/commit/87a09fa3f2a9ab35728a1ac925f9d5f2e6616c65))


### Documentation

* add loading data from Firestore backup sample ([#737](https://www.github.com/googleapis/python-bigquery/issues/737)) ([22fd848](https://www.github.com/googleapis/python-bigquery/commit/22fd848cae4af1148040e1faa31dd15a4d674687))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
parthea pushed a commit that referenced this pull request Mar 9, 2026
@renovate-bot
chore(deps): update dependency grpcio-status to v1.74.0 (#724)
86df251
parthea pushed a commit that referenced this pull request Mar 9, 2026
@renovate-bot
chore(deps): update dependency google-cloud-pubsub to v2.10.0 (#724)
3cc116b
parthea pushed a commit that referenced this pull request Mar 9, 2026
@renovate-bot
chore(deps): update dependency pytest to v7.1.2 (#724)
2eb38db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@craigloftus @coveralls @dhermes @tseaver @googlebot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.