Skip to content
Myr

cleanup

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 464279f · Browse files · 1 file+6 added−1 removed
This commit

State

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

Diff stats

1 file+6 added−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:requests/models.py+6 added-1 removed
675 unmodified lines
676 """Iterates over the response data, one line at a time. This677 avoids reading the content at once into memory for large678 responses.679 """680 #XXX: why rstrip by default680 #TODO: why rstrip by default681 pending = None682683 for chunk in self.iter_content(chunk_size, decode_unicode=decode_unicode):684685 if pending is not None:686 chunk = pending + chunk687 lines = chunk.splitlines(True)688689 for line in lines[:-1]:690 yield line.rstrip()691692 # Save the last part of the chunk for next iteration, to keep full line together693 # lines may be empty for the last chunk of a chunked response694695 if lines:696 pending = lines[-1]697 #if pending is a complete line, give it baack698 if pending[-1] == '\n':
85 unmodified lines