summaryrefslogtreecommitdiffstats
path: root/Lib/io.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/io.py')
-rw-r--r--Lib/io.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 96226e4..9a4f956 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -1262,11 +1262,13 @@ class StringIO(TextIOWrapper):
# XXX This is really slow, but fully functional
- def __init__(self, initial_value=""):
- super(StringIO, self).__init__(BytesIO(), "utf-8")
+ def __init__(self, initial_value="", encoding="utf-8", newline=None):
+ super(StringIO, self).__init__(BytesIO(),
+ encoding=encoding,
+ newline=newline)
if initial_value:
self.write(initial_value)
self.seek(0)
def getvalue(self):
- return self.buffer.getvalue().decode("utf-8")
+ return self.buffer.getvalue().decode(self._encoding)