Serhiy Storchaka added the comment:

But how then other values of newline except '\n' can be useful?

The problem is that newline converting is applied twice, in write() and in 
read(). When constructor uses write() and getvalue() returns same value as 
read(), we have no chance to get newlines encoded or decoded only once. Current 
results for newline != '\n' looks meanless to me.

Here is my half-baked patch. It fixes only _pyio.StringIO, but _io.StringIO are 
still partially broken. The patch also contains new tests.

----------
Added file: http://bugs.python.org/file33876/stringio_newline.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20435>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to