summaryrefslogtreecommitdiff
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-13 16:17:14 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-13 16:17:14 +0000
commit834bd81c51568c12d8dc7ff77025d6a61d5ce7e1 (patch)
treed624b4d8ec3b0ea36edb47486bdd0bfa6184b8c6 /Lib/socket.py
parentf2b1909e0f5df130872afef219b69c833a5750b2 (diff)
downloadcpython-git-834bd81c51568c12d8dc7ff77025d6a61d5ce7e1.tar.gz
Issue #10041: The signature of optional arguments in socket.makefile()
didn't match that of io.open(), and they also didn't get forwarded properly to TextIOWrapper in text mode. Patch by Kai Zhu.
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 0b19e30f91..6af1964811 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -133,7 +133,7 @@ class socket(_socket.socket):
return socket(self.family, self.type, self.proto, fileno=fd), addr
def makefile(self, mode="r", buffering=None, *,
- encoding=None, newline=None):
+ encoding=None, errors=None, newline=None):
"""makefile(...) -> an I/O stream connected to the socket
The arguments are as for io.open() after the filename,
@@ -171,7 +171,7 @@ class socket(_socket.socket):
buffer = io.BufferedWriter(raw, buffering)
if binary:
return buffer
- text = io.TextIOWrapper(buffer, encoding, newline)
+ text = io.TextIOWrapper(buffer, encoding, errors, newline)
text.mode = mode
return text