New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing response.content twice removes forgets read error #4965
Labels
Comments
It looks like we never closed the issue after the PR was merged. I'm reverting #5087 because it doesn't cover all of our read APIs ( I took a quick pass but the edge cases the tests are missing aren't something I can get resolved today. We can reopen a new PR and revisit options later if anyone wants. |
nateprewitt
added a commit
to nateprewitt/requests
that referenced
this issue
Feb 18, 2020
Merged
sethmlarson
pushed a commit
that referenced
this issue
Feb 19, 2020
aless10
pushed a commit
to aless10/requests
that referenced
this issue
Feb 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a hard debugging time today because an error in the response stream is only reported when accessing
response.content
for the first time.This is especially irritating when running code in a debugger.
Expected Result
If accessing
response.content
the first time raises an exception I would expect that accessingresponse.content
again would also raise an exception (ideally the same).Actual Result
Instead after raising on the first get, getting
response.content
again returns an empty string.Reproduction Steps
Here is a patch with a new test case for this: error_replay_test.diff.gz.
Basically, it boils down to this:
Output of my test case:
System Information
Edit: Oops, I used
pipenv run python -m requests.help
which actually called into system python 2.7. Here comes the real data:Thanks for looking into this!
The text was updated successfully, but these errors were encountered: