[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Erick Tryzelaar
Erick Tryzelaar added the comment: Moving this to a documentation bug here: http://bugs.python.org/issue5452 -- message_count: 3.0 -> 4.0 ___ Python tracker ___ _

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Erick Tryzelaar
Erick Tryzelaar added the comment: Thanks Benjamin. Could the documentation for StringIO be updated then? The docs for io.StringIO [1] says that io.TextIOWrapper implements the constructor, but TextIOWrapper defaults newline to None [2], and there's nothing that states that io.StringIO change

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: This is the intended behavior. It is consist with 2.x's StringIO.StringIO behavior. -- message_count: 1.0 -> 2.0 nosy: +benjamin.peterson nosy_count: 1.0 -> 2.0 resolution: -> rejected status: open -> closed ___

[issue5451] patch to make io.StringIO consistent with open with respect to newlines

2009-03-08 Thread Erick Tryzelaar
New submission from Erick Tryzelaar : I noticed that io.StringIO is inconsistent with open on how newlines are handled. The default approach open uses is universal newlines: >>> with open('foo', 'w') as f: ... f.write('hello hi\r\nla la\r\n') ... 17 >>> open('foo').readlines() ['hello hi\n',