From: Guido van Rossum Date: Wed, 29 Aug 2007 18:31:16 +0000 (+0000) Subject: In rseponse to bug# 1029, force the newline default for StringIO to "\n", X-Git-Tag: v3.0a1~133 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e86254e2560250ce958330433488ba092ca8ffea;p=python 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". --- diff --git a/Lib/io.py b/Lib/io.py index 375ae6e2c8..710027852b 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)