summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-27 04:16:28 (GMT)
committerGitHub <noreply@github.com>2021-04-27 04:16:28 (GMT)
commitcfe523b49280cdc8c239c807121ad3f33552f638 (patch)
treeca00ebc35f6401b27bd7276288bfc99716d362a9 /Lib/socket.py
parent743e2bae10d2010fd1e29b772c9da64efc7c9c47 (diff)
downloadcpython-cfe523b49280cdc8c239c807121ad3f33552f638.zip
cpython-cfe523b49280cdc8c239c807121ad3f33552f638.tar.gz
cpython-cfe523b49280cdc8c239c807121ad3f33552f638.tar.bz2
bpo-43651: PEP 597: Fix `socket.makefile()` (GH-25645)
Diffstat (limited to 'Lib/socket.py')
-rwxr-xr-xLib/socket.py1
1 files changed, 1 insertions, 0 deletions
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 @@ class socket(_socket.socket):
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