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 pitrou
Recipients alexandre.vassalotti, pitrou
Date 2009-02-14.22:50:07
SpamBayes Score 2.2319182e-06
Marked as misclassified No
Message-id <1234651808.93.0.485366406394.issue5266@psf.upfronthosting.co.za>
In-reply-to
Content
Or, more precisely, it returns less than the requested number of
characters because characters are counted before translating newlines:

>>> f = io.StringIO("a\r\nb\r\n", newline=None)
>>> f.read(3)
'a\n'

TextIOWrapper gets it right:

>>> g = io.TextIOWrapper(io.BytesIO(b"a\r\nb\r\n"), newline=None)
>>> g.read(3)
'a\nb'
History
Date User Action Args
2009-02-14 22:50:09pitrousetrecipients: + pitrou, alexandre.vassalotti
2009-02-14 22:50:08pitrousetmessageid: <1234651808.93.0.485366406394.issue5266@psf.upfronthosting.co.za>
2009-02-14 22:50:07pitroulinkissue5266 messages
2009-02-14 22:50:07pitroucreate