Issue #11311: StringIO.readline(0) now returns an empty string as all other

file-like objects.
This commit is contained in:
Serhiy Storchaka 2013-02-13 12:26:58 +02:00
parent 34fe1b7a3d
commit 8d7d6bcc25
3 changed files with 6 additions and 1 deletions

View file

@ -158,7 +158,7 @@ class StringIO:
newpos = self.len
else:
newpos = i+1
if length is not None and length > 0:
if length is not None and length >= 0:
if self.pos + length < newpos:
newpos = self.pos + length
r = self.buf[self.pos:newpos]