11001, 'getaddrinfo failed' : Error in httplib but not in urllib2

RajNewbie raj.indian.08 at gmail.com
Mon Dec 1 15:32:58 CET 2008

Hi all,
    I am trying to connect to localhost via httplib, but it fails.
    To check whether it is a firewall problem etc, I tried to connect
via urllib2, but it went through fine.
    Could some one help me out on this? I cannot use urllib2 in the
program because I have to send files via post to a url, and urllib2
doesn't support it (Python2.4)

Please see the code below:
h = httplib.HTTPConnection("")
h.request('GET', "/accounts/")
res = h.getresponse()

req = urllib2.Request("")
fd = urllib2.urlopen(req)


More information about the Python-list mailing list