[New-bugs-announce] [issue7348] StringIO.StringIO.readline(-1) returns the wrong result compared to other file-like objects

Jean-Paul Calderone report at bugs.python.org
Wed Nov 18 19:58:36 CET 2009


New submission from Jean-Paul Calderone <exarkun at divmod.com>:

cStringIO and file both accept -1 to readline to mean the same thing as
not passing any argument at all.  StringIO, on the other hand, gets
totally confused:

  >>> from StringIO import StringIO
  >>> StringIO('a\nb\nfoo').readline(-1)
  'a\nb\nfo'
  >>>

----------
components: Library (Lib)
messages: 95438
nosy: exarkun
severity: normal
status: open
title: StringIO.StringIO.readline(-1)  returns the wrong result compared to other file-like objects

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7348>
_______________________________________


More information about the New-bugs-announce mailing list