mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
bpo-43651: PEP 597: Fix socket.makefile()
(GH-25645)
This commit is contained in:
parent
743e2bae10
commit
cfe523b492
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue