[Python-checkins] r73399 - python/branches/release26-maint/Lib/io.py

alexandre.vassalotti python-checkins at python.org
Fri Jun 12 23:20:23 CEST 2009


Author: alexandre.vassalotti
Date: Fri Jun 12 23:20:23 2009
New Revision: 73399

Log:
Fix issue #6127: Make universal newlines mode of io.StringIO not
duplicate newlines under Windows (see also issue #5265 and #5645).


Modified:
   python/branches/release26-maint/Lib/io.py

Modified: python/branches/release26-maint/Lib/io.py
==============================================================================
--- python/branches/release26-maint/Lib/io.py	(original)
+++ python/branches/release26-maint/Lib/io.py	Fri Jun 12 23:20:23 2009
@@ -1852,6 +1852,10 @@
                                        encoding=encoding,
                                        errors=errors,
                                        newline=newline)
+        # Issue #5645: make universal newlines semantics the same as in the
+        # C version, even under Windows.
+        if newline is None:
+            self._writetranslate = False
         if initial_value:
             if not isinstance(initial_value, unicode):
                 initial_value = unicode(initial_value)


More information about the Python-checkins mailing list