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 serhiy.storchaka
Recipients benjamin.peterson, couplewavylines, docs@python, hynek, pitrou, serhiy.storchaka, stutzbach
Date 2014-01-28.19:51:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390938664.94.0.197345244035.issue20423@psf.upfronthosting.co.za>
In-reply-to
Content
On other hand, may be the behavior of io.StringIO is wrong. Because it is different from io.TextIOWrapper.

>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm')).readlines()
['abc\n', 'def\n', 'ghi\n', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), newline=None).readlines()
['abc\n', 'def\n', 'ghi\n', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), newline='').readlines()
['abc\r\n', 'def\n', 'ghi\r', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), newline='\n').readlines()
['abc\r\n', 'def\n', 'ghi\rklm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), newline='\r').readlines()
['abc\r', '\ndef\nghi\r', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), newline='\r\n').readlines()
['abc\r\n', 'def\nghi\rklm']
History
Date User Action Args
2014-01-28 19:51:04serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, benjamin.peterson, stutzbach, docs@python, hynek, couplewavylines
2014-01-28 19:51:04serhiy.storchakasetmessageid: <1390938664.94.0.197345244035.issue20423@psf.upfronthosting.co.za>
2014-01-28 19:51:04serhiy.storchakalinkissue20423 messages
2014-01-28 19:51:04serhiy.storchakacreate