-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
http module - incorrect reading gzip compressed stream #713
Comments
What is the desired behavior here? |
in really it's good question |
Came across this while trying to solve a problem using
I observed that for some URLs I was able to get a meaningful output file while in other cases it was just gibberish. Comparing between success and failure I determined that the ones that were failing were those with @grubberr your issue helped pinpoint what was going on; changing my code to the following now works for all URLs:
I understand
This really puzzled me for a while, but @grubberr 's explanation of
Now that I know what the issue is and how to work around it, this is by no means a showstopper. I do want to say that |
Hello,
196 bytes - gzip compressed result
209 bytes - uncompressed result
This happened because:
in 1-st case library uses
self.response.raw.read()
- it returns result as is from server, it's gzip compressedin 2-nd case library uses
self.response.iter_content
- result uncompressed byrequests
libraryVersions
Checklist
Before you create the issue, please make sure you have:
The text was updated successfully, but these errors were encountered: