Convert botocore.awsrequest.AWSResponse to dict #759
Closed
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.
take care of business, but that would be too easy
Possible fix for #755 but it's a guess really and it might be specific to
moto
.When this PR code is used against live-s3, it works as expected to list buckets and issue a HEAD request on them, and when a print statement is added, i.e.
print(f"http_response is {type(http_response)}")
With
moto
, thehttp_response
is anbotocore.awsrequest.AWSResponse
, so this is something different. Maybe something is not registered as usual when usingmoto
vs. live-s3 endpoints? Maybemoto
is registering something with thecreating-client-class
and it mutates theclass_attributes
or something to replace some aiobotocore attributes? There's a few events it could use to intercept aiobotocore behavior.The unit tests are passing on this PR with both moto and live-s3 endpoints, but it's not entirely clear whether the response data is already retrieved via aiohttp at the point when the parser is called or whether parsing calls should be able to await a read() of the content.