Describe the bug
f = s3_client.get_object(...)["Body"] # f is StreamingBody object
f.read() # At the end of the stream this will check content-length and raise an error if mismatch
f.close()
is not equal to
with s3_client.get_object(...)["Body"] as f: # f is NOT StreamingBody object
f.read() # This will NOT check content-length
Regression Issue
Expected Behavior
The problem is in StreamingBody.enter. I believe it should return self instead of self._raw_stream.
Current Behavior
StreamingBody.__enter__ returns self._raw_stream instead of self.
Reproduction Steps
See description.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.40.34
Environment details (OS name and version, etc.)
Python 3.10.12
Describe the bug
is not equal to
Regression Issue
Expected Behavior
The problem is in StreamingBody.enter. I believe it should return
selfinstead ofself._raw_stream.Current Behavior
StreamingBody.__enter__returnsself._raw_streaminstead ofself.Reproduction Steps
See description.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.40.34
Environment details (OS name and version, etc.)
Python 3.10.12