Add 'readinfo' shim to botocore.response.StreamingBody #3108
Labels
feature-request
This issue requests a feature.
needs-review
This issue or pull request needs review from a core team member.
p2
This is a standard priority issue
Describe the feature
Provide a
readinto
method forbotocore.response.StreamingBody
.Use Case
Since Python 3.11 we now have
hashlib.file_digest()
which can take a fileobj-ish object and return the digest, this is useful to strap to the back of.get()['Body']
without having to do the slurping of the stream yourself.This does not work as
hashlib.py:file_digest()
tests forreadinto
and finds it missing, so raises aValueError
exception.Proposed Solution
This is an example of shimming it into place and it Works For Me(tm):
Other Information
No response
Acknowledgements
SDK version used
1.34.29
Environment details (OS name and version, etc.)
Debian GNU/Linux 12 (bookworm)
The text was updated successfully, but these errors were encountered: