This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: socket.gethostbyname raises gaierror, not herror
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: ceder, fdrake
Priority: normal Keywords:

Created on 2003-11-07 15:11 by ceder, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg18934 - (view) Author: Per Cederqvist (ceder) Date: 2003-11-07 15:11
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.
msg18935 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-05-05 04:18
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
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39519
2003-11-07 15:11:24cedercreate