As discussed here: https://github.com/terrycain/aioboto3/issues/266 the Body of an s3 object response is now a StreamingBody instance which has a read(amt) method, while the __aenter__ method on that same instance returns the underlying aiohttp client response object, where read() takes no arguments and does not stream (returns the entire body) I thought it would be prudent to update the example in the documentation.
The current example will result in a TypeError as disclosed in the issue referenced at the top of this commit:
TypeError: ClientResponse.read() takes 1 positional argument but 2 were given
... I additionally updated the example to be a bit more terse by using the walrus operator to be able to evaluate the read assignment in the loop.
As discussed here: https://github.com/terrycain/aioboto3/issues/266 the Body of an s3 object response is now a
StreamingBody
instance which has aread(amt)
method, while the__aenter__
method on that same instance returns the underlying aiohttp client response object, whereread()
takes no arguments and does not stream (returns the entire body) I thought it would be prudent to update the example in the documentation.The current example will result in a
TypeError
as disclosed in the issue referenced at the top of this commit:... I additionally updated the example to be a bit more terse by using the walrus operator to be able to evaluate the read assignment in the loop.