Conversation
There was a problem hiding this comment.
I think this should be !CHECK_ERRNO(ECONNRESET), or use GET_SOCK_ERROR instead of errno.
Winsock is an OS library, so it can't use errno of a particular C runtime library. It uses Windows API [WSA]GetLastError and [WSA]SetLastError.
There was a problem hiding this comment.
You should add a versionadded too.
There was a problem hiding this comment.
The socket.dup() function exists since 2.6 at least. It just hasn't been documented yet.
There was a problem hiding this comment.
Is there already a test for dup()?
There was a problem hiding this comment.
No, there is no test. I don't have time to write a test case, Would you like me to drop the documentation for dup?
There was a problem hiding this comment.
If it always does, then how about a assertRaises?
There was a problem hiding this comment.
assertRaises in the finally block may mask an error in the try block.
There was a problem hiding this comment.
Normally, Python 3 would display the exception chain.
Add close(fd) function to the socket module Signed-off-by: Christian Heimes <[email protected]>
|
I removed the documentation for |
|
@tiran: Please replace |
|
thx @pitrou |
Add close(fd) function to the socket module
Signed-off-by: Christian Heimes [email protected]
NOTE The PR also documents the previously undocumented
socket.closefunction.https://bugs.python.org/issue32454