pythonbottle

"getaddrinfo failed", what does that mean?


  File "C:\Python27\lib\socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)   gaierror: [Errno 11004]
getaddrinfo failed

Getting this error when launching the "Hello World" sample from the Bottle documentation


Solution

  • It most likely means the hostname can't be resolved.

    import socket
    socket.getaddrinfo('localhost', 8080)
    

    If it doesn't work there, it's not going to work in the Bottle example. You can try '127.0.0.1' instead of 'localhost' in case that's the problem.