Skip to content

Fixed chunk_size values in iter_content() and iter_lines(). False default instead of None. #589

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def ok(self):
return False
return True

def iter_content(self, chunk_size=1, decode_unicode=False):
def iter_content(self, chunk_size=10 * 1024, decode_unicode=False):
"""Iterates over the response data. This avoids reading the content
at once into memory for large responses. The chunk size is the number
of bytes it should read into memory. This is not necessarily the
Expand All @@ -731,7 +731,7 @@ def generate():

return gen

def iter_lines(self, chunk_size=10 * 1024, decode_unicode=None):
def iter_lines(self, chunk_size=1, decode_unicode=False):
"""Iterates over the response data, one line at a time. This
avoids reading the content at once into memory for large
responses.
Expand Down