Patch #1014992: Never return more than a line from readline.
Will backport to 2.3.
This commit is contained in:
parent
8d494f3241
commit
c11d6f13ae
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue