This repository was archived by the owner on Mar 6, 2026. It is now read-only.
bugfix: fix async certificate decoding#1085
Merged
clundin25 merged 1 commit intogoogleapis:mainfrom Jul 22, 2022
Merged
Conversation
TimurSadykov
approved these changes
Jul 20, 2022
| data = await response.data.read() | ||
|
|
||
| return json.loads(json.dumps(data)) | ||
| return json.loads(data.decode("utf-8")) |
There was a problem hiding this comment.
This works )
and a question to @arithmetic1728: I wonder if there is a way we can decode all the responses at the time we get them... so we don't have to remember this next time
Contributor
There was a problem hiding this comment.
I think this can be achieved by adding a new decoded_data property in parallel to the data property in the _Response class
google-auth-library-python/google/auth/transport/requests.py
Lines 73 to 75 in 6f49d1f
37d2843 to
ea58c02
Compare
sai-sunder-s
approved these changes
Jul 21, 2022
The async `_cert_fetch` implementation was not properly decoding certificates into a utf-8 string. This updates the code and tests to decode the certificates into strings. This resolves googleapis#1050.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The async _cert_fetch implementation was not properly decoding
certificates into a utf-8 string. This updates the code and tests to
decode the certificates into strings.
Without this fix, the code will raise a
ValueErrorexception, because the data type passed tojson.dumpsis not expected.This resolves #1050.