Commit dd0b90a3 authored by Alexandre Vassalotti's avatar Alexandre Vassalotti

Fix issue #6127: Make universal newlines mode of io.StringIO not

duplicate newlines under Windows (see also issue #5265 and #5645).
parent d97d1fdc
......@@ -1852,6 +1852,10 @@ class StringIO(TextIOWrapper):
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment