Issue 2918: Merge StringIO and cStringIO.
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 2d91cbd..d1745bc 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -10,7 +10,7 @@
 import sys
 
 try:
-    import _bytesio
+    import _bytesio, _stringio
     has_c_implementation = True
 except ImportError:
     has_c_implementation = False
@@ -373,7 +373,7 @@
 
 class PyStringIOTest(MemoryTestMixin, unittest.TestCase):
     buftype = str
-    ioclass = io.StringIO
+    ioclass = io._StringIO
     EOF = ""
 
     def test_relative_seek(self):
@@ -404,10 +404,14 @@
     class CBytesIOTest(PyBytesIOTest):
         ioclass = io.BytesIO
 
+    class CStringIOTest(PyStringIOTest):
+        ioclass = io.StringIO
+
+
 def test_main():
     tests = [PyBytesIOTest, PyStringIOTest]
     if has_c_implementation:
-        tests.extend([CBytesIOTest])
+        tests.extend([CBytesIOTest, CStringIOTest])
     support.run_unittest(*tests)
 
 if __name__ == '__main__':
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index ca1f836..c4c568f 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -3,7 +3,6 @@
 import os
 import sys
 import pickle
-from io import StringIO
 from test.support import verbose, run_unittest, TestSkipped
 import unittest
 
@@ -80,7 +79,7 @@
         self.confirm(t == s, "looking for %s, found %s" % (repr(s), repr(t)))
 
     def testParseFromFile(self):
-        dom = parse(StringIO(open(tstfile).read()))
+        dom = parse(open(tstfile))
         dom.unlink()
         self.confirm(isinstance(dom, Document))
 
diff --git a/Lib/test/test_uu.py b/Lib/test/test_uu.py
index 02d0171..d2b6e73 100644
--- a/Lib/test/test_uu.py
+++ b/Lib/test/test_uu.py
@@ -17,6 +17,32 @@
 M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
 (:6YG(&1O9PH """
 
+# Stolen from io.py
+class FakeIO(io.TextIOWrapper):
+    """Text I/O implementation using an in-memory buffer.
+
+    Can be a used as a drop-in replacement for sys.stdin and sys.stdout.
+    """
+
+    # XXX This is really slow, but fully functional
+
+    def __init__(self, initial_value="", encoding="utf-8",
+                 errors="strict", newline="\n"):
+        super(FakeIO, self).__init__(io.BytesIO(),
+                                     encoding=encoding,
+                                     errors=errors,
+                                     newline=newline)
+        if initial_value:
+            if not isinstance(initial_value, str):
+                initial_value = str(initial_value)
+            self.write(initial_value)
+            self.seek(0)
+
+    def getvalue(self):
+        self.flush()
+        return self.buffer.getvalue().decode(self._encoding, self._errors)
+
+
 def encodedtextwrapped(mode, filename):
     return (bytes("begin %03o %s\n" % (mode, filename), "ascii") +
             encodedtext + b"\n \nend\n")
@@ -76,15 +102,15 @@
         sys.stdout = self.stdout
 
     def test_encode(self):
-        sys.stdin = io.StringIO(plaintext.decode("ascii"))
-        sys.stdout = io.StringIO()
+        sys.stdin = FakeIO(plaintext.decode("ascii"))
+        sys.stdout = FakeIO()
         uu.encode("-", "-", "t1", 0o666)
         self.assertEqual(sys.stdout.getvalue(),
                          encodedtextwrapped(0o666, "t1").decode("ascii"))
 
     def test_decode(self):
-        sys.stdin = io.StringIO(encodedtextwrapped(0o666, "t1").decode("ascii"))
-        sys.stdout = io.StringIO()
+        sys.stdin = FakeIO(encodedtextwrapped(0o666, "t1").decode("ascii"))
+        sys.stdout = FakeIO()
         uu.decode("-", "-")
         stdout = sys.stdout
         sys.stdout = self.stdout