projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95911f0
)
Make sure newlines at chunk borders do not get dropped using iter_lines.
author
Chase Sterling
<chase.sterling@gmail.com>
Tue, 3 Jan 2012 05:38:59 +0000
(
00:38
-0500)
committer
Chase Sterling
<chase.sterling@gmail.com>
Tue, 3 Jan 2012 05:38:59 +0000
(
00:38
-0500)
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index
9b01fb2
..
5bfd3fa
100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-636,15
+636,15
@@
class Response(object):
for chunk in self.iter_content(chunk_size, decode_unicode=decode_unicode):
if pending is not None:
chunk = pending + chunk
- lines = chunk.splitlines()
+ lines = chunk.splitlines(
True
)
for line in lines[:-1]:
- yield line
+ yield line
.rstrip()
# Save the last part of the chunk for next iteration, to keep full line together
pending = lines[-1]
# Yield the last line
if pending is not None:
- yield pending
+ yield pending
.rstrip()
@property