fix unicode errors in resolve_ip with python 2.7