Skip to content
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

Python 3.x (x < 6): 'get_body(response)' returns bytes to 'json.loads()' #12

Closed
tseaver opened this issue Jul 13, 2017 · 1 comment
Closed
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. upload

Comments

@tseaver
Copy link
Contributor

tseaver commented Jul 13, 2017

See: googleapis/google-cloud-python#3577 (comment)

@dhermes
Copy link
Contributor

dhermes commented Jul 13, 2017

I should probably just evict this json.loads() code all together:

json_response = json.loads(self._get_body(response))
self._bytes_uploaded = int(json_response[u'size'])

I had thought it was "universal" that all APIs return size but IIRC even the BigQuery API does not (so this code block would need to change before #3555 can be successfully merged).

@dhermes dhermes added the bug label Jul 13, 2017
@dhermes dhermes self-assigned this Jul 13, 2017
@dhermes dhermes added the upload label Jul 13, 2017
dhermes added a commit to dhermes/google-resumable-media-python that referenced this issue Jul 18, 2017
dhermes added a commit to dhermes/google-resumable-media-python that referenced this issue Jul 18, 2017
@tseaver tseaver added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed bug labels Jan 16, 2019
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. upload
Projects
None yet
Development

No branches or pull requests

3 participants