New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading documentation for socket.fromfd() #43110
Comments
The socket.fromfd() method does not correctly document Proposed fix: --- Modules/socketmodule.c 2005-09-14
20:15:03.000000000 +0200
+++
/home/msmith/src/Python-2.4.2/Modules/socketmodule.c
2006-03-29 11:28:35.000000000 +0200
@@ -3077,7 +3077,8 @@
PyDoc_STRVAR(fromfd_doc,
"fromfd(fd, family, type[, proto]) -> socket object\n\
\n\
-Create a socket object from the given file descriptor.\n\
+Duplicate the given file descriptor, and create a
socket\n\
+object from the duplicate.\r\
The remaining arguments are the same as for socket()."); #endif /* NO_DUP */ |
Logged In: YES I don't believe the comment is incorrect, but I think the socket.fromfd() is designed to be used when stdin/out/err |
Logged In: YES It is not an error to dup() the fd here, but it IS behaviour Also, changing this behaviour will probably break most users FWIW: my app receives file descriptors - which are sockets - |
Logged In: YES I don't believe the comment is incorrect, but I think the socket.fromfd() is designed to be used when stdin/out/err |
Logged In: YES I still believe that fromfd() is in error in dup'ing the The Library Documentation for includes the comment "This I can't conceive of any case where it would be necessary for Regarding breaking existing code:
|
Logged In: YES I'm not going to remove the dup() since it may be relied I've corrected the docs in rev. 43523, 43524. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: