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. ...@@ -588,7 +588,7 @@ correspond to Unix system calls applicable to sockets.
is system-dependent (usually 5). 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 .. index:: single: I/O control; buffering
......
...@@ -121,7 +121,7 @@ class socket(_socket.socket): ...@@ -121,7 +121,7 @@ class socket(_socket.socket):
return socket(self.family, self.type, self.proto, fileno=fd), addr return socket(self.family, self.type, self.proto, fileno=fd), addr
def makefile(self, mode="r", buffering=None, *, 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 """makefile(...) -> an I/O stream connected to the socket
The arguments are as for io.open() after the filename, The arguments are as for io.open() after the filename,
...@@ -159,7 +159,7 @@ class socket(_socket.socket): ...@@ -159,7 +159,7 @@ class socket(_socket.socket):
buffer = io.BufferedWriter(raw, buffering) buffer = io.BufferedWriter(raw, buffering)
if binary: if binary:
return buffer return buffer
text = io.TextIOWrapper(buffer, encoding, newline) text = io.TextIOWrapper(buffer, encoding, errors, newline)
text.mode = mode text.mode = mode
return text return text
......
This diff is collapsed.
...@@ -872,5 +872,6 @@ Artur Zaprzala ...@@ -872,5 +872,6 @@ Artur Zaprzala
Mike Zarnstorff Mike Zarnstorff
Siebren van der Zee Siebren van der Zee
Uwe Zessin Uwe Zessin
Kai Zhu
Tarek Ziadé Tarek Ziadé
Peter Åstrand Peter Åstrand
...@@ -125,6 +125,10 @@ C-API ...@@ -125,6 +125,10 @@ C-API
Library 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 - Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
current directory was deleted. Patch written by W. Trevor King. 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