This bug exists in Python 2.3.2, 2.3.3 and 2.3.4. socket.gethostbyname is broken on hpux HP-UX B.11.11 U. This is what I'm getting when I try to call socket.gethostbyname('server'): Traceback (most recent call last): File "../../test.py", line 2, in ? a=socket.gethostbyname('myserver') socket.gaierror: (8, 'host nor service provided, or not known') I got the same error when I tried getaddrinfo(server, port).
Logged In: YES user_id=1069522 The servername is supposed to be resolved via DNS query to get thje ip address. If I use the ip address instead of the servername, the function works fine [i.e. socket.gethostbyname('x.x.x.x') works fine.]
Logged In: YES user_id=21627 Can you investigate this in more detail, and suggest a patch? If not, it is unlikely that it will be fixed anytime soon, because the bug is likely specific to the operating system, and might be even specific to your installation.
Logged In: YES user_id=1069522 By looking more into this problem, I found that several development groups have reported the exact same problem with hpux 11.11. The fix for them was to install DNS patch PHNE_27796 along with other patches. However, these patch did not fix my problem. As a workaround, I commented out HAVE_GETADDRINFO in pyconfig.h. This allowed getaddrinfo from python distribution to take place as oppose to the broken one from HP. This workaround fixed the problem. I'm closing this bug as it's apparently not in python nor python can fix it.