[Python-Dev] IPv6 docs (original) (raw)

Jun-ichiro itojun Hagino itojun@iijlab.net
Sun, 05 Aug 2001 13:58:31 +0900


You write that socket.herror and socket.gaierror may both take either a string or a pair of error number/message. Is this correct, or was that a cut-n-paste error from socket.error?

yes, it is a cut-n-paste error.  herror and gaierror is always a
2-tuple.

You also write that socket.gethostbyname may raise socket.herror. Is this true? It seems that you'll always get socket.gaierror instead. I've changed it to say that gethostbynameex may raise herrors.

with C API gethostbyname() should return h_error.  Python code
internaly uses getnameinfo/getaddrinfo, so it returns socket.gaierror.
you right.

itojun