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

SourceForge.net noreply at sourceforge.net
Fri Nov 7 10:11:25 EST 2003


Bugs item #837929, was opened at 2003-11-07 16:11
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
Priority: 5
Submitted By: Per Cederqvist (ceder)
Assigned to: Nobody/Anonymous (nobody)
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.


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

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