SF patch# 1764815 by Paul Colomiets.
Fix for test_socketserver.
Use io.BytesIO instead of io.StringIO, and adjust tests.
diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py
index c6e71eb..994a3c6 100644
--- a/Lib/SocketServer.py
+++ b/Lib/SocketServer.py
@@ -574,10 +574,10 @@
     """Define self.rfile and self.wfile for datagram sockets."""
 
     def setup(self):
-        from io import StringIO
+        from io import BytesIO
         self.packet, self.socket = self.request
-        self.rfile = StringIO(self.packet)
-        self.wfile = StringIO()
+        self.rfile = BytesIO(self.packet)
+        self.wfile = BytesIO()
 
     def finish(self):
         self.socket.sendto(self.wfile.getvalue(), self.client_address)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index da936a4..6682d71 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -38,7 +38,7 @@
         self.server_close()
         raise
 
-teststring = "hello world\n"
+teststring = b"hello world\n"
 
 def receive(sock, n, timeout=20):
     r, w, x = select.select([sock], [], [], timeout)
@@ -51,7 +51,7 @@
     s = socket.socket(proto, socket.SOCK_DGRAM)
     s.sendto(teststring, addr)
     buf = data = receive(s, 100)
-    while data and '\n' not in buf:
+    while data and b'\n' not in buf:
         data = receive(s, 100)
         buf += data
     verify(buf == teststring)
@@ -62,7 +62,7 @@
     s.connect(addr)
     s.sendall(teststring)
     buf = data = receive(s, 100)
-    while data and '\n' not in buf:
+    while data and b'\n' not in buf:
         data = receive(s, 100)
         buf += data
     verify(buf == teststring)