[Python-3000-checkins] r57668 - python/branches/py3k/Lib/io.py

guido.van.rossum python-3000-checkins at python.org
Wed Aug 29 20:31:16 CEST 2007


Author: guido.van.rossum
Date: Wed Aug 29 20:31:16 2007
New Revision: 57668

Modified:
   python/branches/py3k/Lib/io.py
Log:
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".


Modified: python/branches/py3k/Lib/io.py
==============================================================================
--- python/branches/py3k/Lib/io.py	(original)
+++ python/branches/py3k/Lib/io.py	Wed Aug 29 20:31:16 2007
@@ -1390,7 +1390,7 @@
 
     # 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)


More information about the Python-3000-checkins mailing list