Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index aab60db..a9b0064 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -2044,7 +2044,7 @@
     def __init__(self, initial_value="", newline="\n"):
         super(StringIO, self).__init__(BytesIO(),
                                        encoding="utf-8",
-                                       errors="strict",
+                                       errors="surrogatepass",
                                        newline=newline)
         # Issue #5645: make universal newlines semantics the same as in the
         # C version, even under Windows.