Skip to content
Myr

chunk_size iter_lines

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent c7f165a · Browse files · 2 files+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−2 removed

  • other:+7 added−2 removed

2 files+7 added−2 removed

modified:requests/models.py+4 added-2 removed
702 unmodified lines
703 gen = stream_decode_response_unicode(gen, self)704705 return gen706707 def iter_lines(self, decode_unicode=None):707 def iter_lines(self, chunk_size=10 * 1024, decode_unicode=None):708 """Iterates over the response data, one line at a time. This709 avoids reading the content at once into memory for large710 responses.711 """712713 pending = None714715 for chunk in self.iter_content(chunk_size=10 * 1024, decode_unicode=decode_unicode):715 for chunk in self.iter_content(716 chunk_size=chunk_size,717 decode_unicode=decode_unicode):718719 if pending is not None:720 chunk = pending + chunk721 lines = chunk.splitlines()
79 unmodified lines
modified:HISTORY.rst+3 added
4 unmodified lines
5+++++++++++++++++++67* Generate chunked ValueError fix8* Proxy configuration by environment variables9* Simplification of iter_lines.10* New `trust_env` configuration for disabling system/environment hints.111213140.10.7 (2012-03-07)15+++++++++++++++++++1617* `encode_uri` = False
401 unmodified lines