Commit c11d6f13 authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #1014992: Never return more than a line from readline.

Will backport to 2.3.
parent 8d494f32
......@@ -509,14 +509,12 @@ class ExFileObject(object):
nl = min(nl, size)
else:
size -= len(self.linebuffer)
while nl < 0:
while (nl < 0 and size > 0):
buf = self.read(min(size, 100))
if not buf:
break
self.linebuffer += buf
size -= len(buf)
if size <= 0:
break
nl = self.linebuffer.find("\n")
if nl == -1:
s = self.linebuffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment