-
Notifications
You must be signed in to change notification settings - Fork 1.6k
json.loads error with Python 3.4 in gcloud.storage.connection.Connection.api_request #697
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
Conversation
…nnection.api_request is decoded to a string before being passed to json.loads
|
The tests that have failed because they mock the response and assume a Of course, I could update the PR to change the assumption in the tests, but somehow that feels like the wrong approach? |
|
Please do update the tests to make the mocked payloads bytes. |
|
Darn. I didn't realise github would keep updating the PR - I am having to run the test suite with Travis (on my fork) as I couldn't get Tox to run locally. |
|
Going to kill this PR and come back when I have something that works. |
|
@craigloftus I'm happy to help get |
|
@dhermes Thanks. I have travis building against my fork, which has let me get somewhere. After a couple of attempts I changed the mocked This travis build of my fork shows the remaining issue, which is actually the root cause of Issue #653; that the exception handling code is expecting |
|
@craigloftus Can you send error output from your issues running As for the remaining errors, it looks like you aren't JSON parsing the errors. It can be addressed by changing one line if isinstance(content, str):to if isinstance(content, six.string_types):UPDATE: I just realized |
|
@dhermes My issue is mainly that I have no idea how to use Yeah. I think I now have a commit (craigloftus@e7ffadc7) which is passing on all python versions. It will probably be tomorrow before I get a chance to figure out how to rebase and squash my changes into a neat PR. |
|
@craigloftus You can use tox just by running Googling for your [sudo] pip install --upgrade tox virtualenv(The |
Source-Link: googleapis/synthtool@bc07fd4 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:30470597773378105e239b59fce8eb27cc97375580d592699206d17d117143d0 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@bc07fd4 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:30470597773378105e239b59fce8eb27cc97375580d592699206d17d117143d0 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ### [0.35.11](https://www.github.com/googleapis/gapic-generator-python/compare/v0.35.10...v0.35.11) (2020-11-12) ### Bug Fixes * add enums to types/__init__.py ([#695](https://www.github.com/googleapis/gapic-generator-python/issues/695)) ([e1d4a4a](https://www.github.com/googleapis/gapic-generator-python/commit/e1d4a4ae768a631f6e6dc28f2acfde8be8dc4a8f)) * update protobuf version [gapic-generator-python] ([#696](https://www.github.com/googleapis/gapic-generator-python/issues/696)) ([ea3e519](https://www.github.com/googleapis/gapic-generator-python/commit/ea3e5198862881f5b142638df6ea604654f81f82)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
* fix: add pyopenssl as extra dependency * update
When using Python 3
httplib2returns request content asbytesbutjson.loadsrequiresstr.It might be desirable to examine the content-type header returned by
httplib2to decided which encoding to use, although it is likely to always beutf-8?