Commit 674f4009 authored by Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 85420 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85420 | antoine.pitrou | 2010-10-13 18:17:14 +0200 (mer., 13 oct. 2010) | 5 lines

  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.
........
parent bc5d78d3
......@@ -588,7 +588,7 @@ correspond to Unix system calls applicable to sockets.
is system-dependent (usually 5).
.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, newline=None)
.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, errors=None, newline=None)
.. index:: single: I/O control; buffering
......
......@@ -121,7 +121,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,
......@@ -159,7 +159,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
......
This diff is collapsed.
......@@ -872,5 +872,6 @@ Artur Zaprzala
Mike Zarnstorff
Siebren van der Zee
Uwe Zessin
Kai Zhu
Tarek Ziadé
Peter Åstrand
......@@ -125,6 +125,10 @@ C-API
Library
-------
- 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.
- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
current directory was deleted. Patch written by W. Trevor King.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment