[ python-Bugs-837929 ] socket.gethostbyname raises gaierror, not herror

SourceForge.net noreply at sourceforge.net
Wed May 5 00:18:38 EDT 2004


Bugs item #837929, was opened at 2003-11-07 10:11
Message generated for change (Comment added) made by fdrake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=837929&group_id=5470

Category: Documentation
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Per Cederqvist (ceder)
>Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: socket.gethostbyname raises gaierror, not herror

Initial Comment:
http://www.python.org/doc/current/lib/module-socket.html
states that socket.gethostbyaddr() raises herror if the
host isn't found.  That isn't true in Python 2.3.2:

Python 2.3.2 (#1, Oct  5 2003, 12:10:05) 
[GCC 3.3.1] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import socket
>>> socket.gethostbyname('finnsinte.ingate.se')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
socket.gaierror: (-2, 'Name or service not known')
>>> 

Also, the description of gaierror should mention that
the error value is set to one of the socket.EAI_*
constants.


----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2004-05-05 00:18

Message:
Logged In: YES 
user_id=3066

The offending misinformation about which exception is raised
has already been removed from CVS.  I've added a note about
gaierror and the EAI_* constants for Python 2.3.4 and 2.4.

Doc/lib/libsocket.tex revisions  1.82, 1.76.6.2

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=837929&group_id=5470



More information about the Python-bugs-list mailing list