[python] caution on using socket module to check for hostname

I had a problem which socket threw an exception when i was testing whether an object is a hostname or not. the error is this socket.gaierror: [errno 11004] getaddrinfo failed this is because if the source is not a hostname but is an ip address the testing of socket.gethostbyname() will still be true. A solution … Continue reading [python] caution on using socket module to check for hostname