summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-29 18:31:16 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-29 18:31:16 (GMT)
commite86254e2560250ce958330433488ba092ca8ffea (patch)
treea9493cfbe89e9a344e25ecbf8f6526c199a552cb /Lib
parent5f7b087f6685e1f5ee1815781566834d62831982 (diff)
downloadcpython-e86254e2560250ce958330433488ba092ca8ffea.zip
cpython-e86254e2560250ce958330433488ba092ca8ffea.tar.gz
cpython-e86254e2560250ce958330433488ba092ca8ffea.tar.bz2
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".
Diffstat (limited to 'Lib')
-rw-r--r--Lib/io.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 375ae6e..7100278 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -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)