[Python-checkins] cpython (2.7): Closes #14303: socket.makefile() does not call dup() anymore on the socket fd.

georg.brandl python-checkins at python.org
Mon Oct 6 16:36:32 CEST 2014


https://hg.python.org/cpython/rev/6e2a72e05b4f
changeset:   92851:6e2a72e05b4f
branch:      2.7
user:        Georg Brandl <georg at python.org>
date:        Mon Oct 06 16:36:20 2014 +0200
summary:
  Closes #14303: socket.makefile() does not call dup() anymore on the socket fd.

files:
  Doc/library/socket.rst |  8 +++++---
  1 files changed, 5 insertions(+), 3 deletions(-)


diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -661,9 +661,11 @@
    .. index:: single: I/O control; buffering
 
    Return a :dfn:`file object` associated with the socket.  (File objects are
-   described in :ref:`bltin-file-objects`.) The file object
-   references a :c:func:`dup`\ ped version of the socket file descriptor, so the
-   file object and socket object may be closed or garbage-collected independently.
+   described in :ref:`bltin-file-objects`.) The file object does not close the
+   socket explicitly when its :meth:`close` method is called, but only removes
+   its reference to the socket object, so that the socket will be closed if it
+   is not referenced from anywhere else.
+
    The socket must be in blocking mode (it can not have a timeout). The optional
    *mode* and *bufsize* arguments are interpreted the same way as by the built-in
    :func:`file` function.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list