[Python-checkins] r43524 - in python/branches/release24-maint: Doc/lib/libsocket.tex Modules/socketmodule.c

georg.brandl python-checkins at python.org
Sat Apr 1 09:33:25 CEST 2006


Author: georg.brandl
Date: Sat Apr  1 09:33:22 2006
New Revision: 43524

Modified:
   python/branches/release24-maint/Doc/lib/libsocket.tex
   python/branches/release24-maint/Modules/socketmodule.c
Log:
Bug #1460564: document that socket.fromfd() duplicates the given
file descriptor.
 (backport from rev. 43523)

Modified: python/branches/release24-maint/Doc/lib/libsocket.tex
==============================================================================
--- python/branches/release24-maint/Doc/lib/libsocket.tex	(original)
+++ python/branches/release24-maint/Doc/lib/libsocket.tex	Sat Apr  1 09:33:22 2006
@@ -314,10 +314,11 @@
 \end{funcdesc}
 
 \begin{funcdesc}{fromfd}{fd, family, type\optional{, proto}}
-Build a socket object from an existing file descriptor (an integer as
-returned by a file object's \method{fileno()} method).  Address family,
-socket type and protocol number are as for the \function{socket()} function
-above.  The file descriptor should refer to a socket, but this is not
+Duplicate the file descriptor \var{fd} (an integer as returned by a file
+object's \method{fileno()} method) and build a socket object from the
+result.  Address family, socket type and protocol number are as for the
+\function{socket()} function above.
+The file descriptor should refer to a socket, but this is not
 checked --- subsequent operations on the object may fail if the file
 descriptor is invalid.  This function is rarely needed, but can be
 used to get or set socket options on a socket passed to a program as

Modified: python/branches/release24-maint/Modules/socketmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/socketmodule.c	(original)
+++ python/branches/release24-maint/Modules/socketmodule.c	Sat Apr  1 09:33:22 2006
@@ -3113,7 +3113,8 @@
 PyDoc_STRVAR(fromfd_doc,
 "fromfd(fd, family, type[, proto]) -> socket object\n\
 \n\
-Create a socket object from the given file descriptor.\n\
+Create a socket object from a duplicate of the given\n\
+file descriptor.\n\
 The remaining arguments are the same as for socket().");
 
 #endif /* NO_DUP */


More information about the Python-checkins mailing list