-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
bugThis issue is a confirmed bug.This issue is a confirmed bug.p3This is a minor priority issueThis is a minor priority issue
Description
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
- Select this option if this issue appears to be a regression.
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
Metadata
Metadata
Assignees
Labels
bugThis issue is a confirmed bug.This issue is a confirmed bug.p3This is a minor priority issueThis is a minor priority issue