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 jaraco
Recipients jaraco
Date 2009-05-27.20:01:41
SpamBayes Score 2.2822364e-07
Marked as misclassified No
Message-id <1243454503.32.0.886233661759.issue6127@psf.upfronthosting.co.za>
In-reply-to
Content
Per http://bugs.python.org/issue5265, I'm opening up a new ticket. 
Universal newline behavior works as expected under Linux but differently
under Windows.

PS C:\Users\jaraco> python
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on win32
>>> import io
>>> io.StringIO('foo\r\nbar\r\n', newline=None).read()
u'foo\n\nbar\n\n'

As you can see, the newlines get duplicated.

The problem doesn't seem to be with universal newline support in
general, but the StringIO implementation in particular.

PS C:\Users\jaraco\projects\formworx> python
Python 2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit
(AMD64)] on win32
>>> open("testnl.txt", "wb").write("foo\r\nbar\r\n")
>>> open("testnl.txt", "rU").read()
'foo\nbar\n'
History
Date User Action Args
2009-05-27 20:01:43jaracosetrecipients: + jaraco
2009-05-27 20:01:43jaracosetmessageid: <1243454503.32.0.886233661759.issue6127@psf.upfronthosting.co.za>
2009-05-27 20:01:42jaracolinkissue6127 messages
2009-05-27 20:01:41jaracocreate