StreamingBody Issue in Record Mode
See original GitHub issueToday I had the problem with the following code in record mode:
stdout_key = self._s3.Object(bucket_name='somebucket',
key='{}/stdout'.format(location))
result_output = stdout_key.get()['Body'].read()
No matter what, result_output
was always ''
. After some digging, I was able to determine that the stream was already read.
(Pdb) test = stdout_key.get()['Body']
(Pdb) test._raw_stream.tell()
5
Important note: the tests run fine and work as expected when in playback mode, and the content of the StreamingBody is saved correctly to the cassette.
My assumption: Placebo is read()
ing the StreamingBody while in record mode so that it can save it to the cassette.
Is there any way we can still present the results correctly? I’d like to avoid having my tests fail in record mode and then pass during playback mode. 😛
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Boto3 S3 StreamingBody().read() reads once and returns ...
complete bytes removed for brevity. I get an object, and read it. Then I read it again, but no bytes are returned.
Read more >Unable to read botocore.response.StreamingBody due to ...
The csv contains mostly numerical values and some categorical values for training a machine learning model. It has got 228945 lines of records...
Read more >Streaming Data with Spring Boot - Medium
In this article, we are going to look at an example to download files using StreamingResponseBody. In this approach, data is processed and ......
Read more >S3 — Boto3 Docs 1.26.36 documentation - Amazon AWS
BypassGovernanceRetention (boolean) -- Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation.
Read more >Two Buckets and a Lambda: a pattern for file processing
In many cases it's a simple matter of moving the files back into ... is that they assume there will only be a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@fxfitz I ran into the same issue. your patch works for me. great job - thank you!
Awesome, @markfink! Thanks for the feedback! 😄