bpo-43651: PEP 597: Fix `socket.makefile()` (GH-25645)

diff --git a/Lib/socket.py b/Lib/socket.py
index 5276cc8..fc11eb7 100755
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -337,6 +337,7 @@ def makefile(self, mode="r", buffering=None, *,
             buffer = io.BufferedWriter(raw, buffering)
         if binary:
             return buffer
+        encoding = io.text_encoding(encoding)
         text = io.TextIOWrapper(buffer, encoding, errors, newline)
         text.mode = mode
         return text