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

Use proper API in http_to_file #521

Closed
dgilman opened this Issue Oct 29, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@dgilman

dgilman commented Oct 29, 2017

http_to_file() in twitter_utils.py gets data out of the Response object as Response.raw.data which is a property from the underlying urllib3 library that doesn't do the proper decoding. If the server sent gzipped data it won't be decompressed. Response.content should be used instead as it handles the decoding for you (see https://github.com/requests/requests/blob/master/requests/models.py#L724 , decode_content=True)

@jeremylow

This comment has been minimized.

Collaborator

jeremylow commented Mar 8, 2018

Fixed in 2bf461f

Thanks!

@jeremylow jeremylow closed this Mar 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment