mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix issue #6127: Make universal newlines mode of io.StringIO not
duplicate newlines under Windows (see also issue #5265 and #5645).
This commit is contained in:
parent
d97d1fdc60
commit
dd0b90a367
1 changed files with 4 additions and 0 deletions
|
@ -1852,6 +1852,10 @@ class StringIO(TextIOWrapper):
|
||||||
encoding=encoding,
|
encoding=encoding,
|
||||||
errors=errors,
|
errors=errors,
|
||||||
newline=newline)
|
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 initial_value:
|
||||||
if not isinstance(initial_value, unicode):
|
if not isinstance(initial_value, unicode):
|
||||||
initial_value = unicode(initial_value)
|
initial_value = unicode(initial_value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue