This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients exarkun, terry.reedy
Date 2009-11-20.21:45:07
SpamBayes Score 1.8148118e-08
Marked as misclassified No
Message-id <1258753509.61.0.400648802801.issue7348@psf.upfronthosting.co.za>
In-reply-to
Content
You specified neither version nor system.
On 3.1, Windows
>>> from io import StringIO as s
>>> s('a\nb\nfoo').readline(-1)

'a\n'

which, I gather, is what you describe as expected, although using -1 to
mean None is rather weird. 

The 3.1 doc says only 
"readline(limit=-1) 
Read and return one line from the stream. If limit is specified, at most
limit bytes will be read."
which would imply that negative numbers are the same as 0.

So even in 3.1, either the behavior is wrong or the doc is incomplete.
History
Date User Action Args
2009-11-20 21:45:09terry.reedysetrecipients: + terry.reedy, exarkun
2009-11-20 21:45:09terry.reedysetmessageid: <1258753509.61.0.400648802801.issue7348@psf.upfronthosting.co.za>
2009-11-20 21:45:08terry.reedylinkissue7348 messages
2009-11-20 21:45:07terry.reedycreate