mirror of https://github.com/python/cpython
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".
This commit is contained in:
parent
5f7b087f66
commit
e86254e256
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue