Commit e86254e2 authored by Guido van Rossum's avatar Guido van Rossum

In rseponse to bug# 1029, force the newline default for StringIO to "\n",

so that even on Windows, after s.write("x\n"), s.getvalue() == "x\n".
parent 5f7b087f
......@@ -1390,7 +1390,7 @@ class StringIO(TextIOWrapper):
# XXX This is really slow, but fully functional
def __init__(self, initial_value="", encoding="utf-8", newline=None):
def __init__(self, initial_value="", encoding="utf-8", newline="\n"):
super(StringIO, self).__init__(BytesIO(),
encoding=encoding,
newline=newline)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment