<urlopen error (11001, 'getaddrinfo failed')>

opengis at hushmail.com opengis at hushmail.com
Thu Sep 10 12:22:01 EDT 2009


Hello Python User,
I am using python in an openlayers application to access another 
server on my network via javascript.  The proxy script works fine 
when the application runs in Apache HTTP Server, but I get a 
"<urlopen error (11001, 'getaddrinfo failed')>" error after moving 
the application to Tomcat.  The tomcat cgi configuration tested 
fine with a "hello world" python script.  I then boiled my proxy 
script down to the following:

#!c:/Program Files/Python25/python.exe -u

import urllib2
import cgi

fs = cgi.FieldStorage()
url = fs.getvalue('url', "http://www.openlayers.org")
try:
    y = urllib2.urlopen(url)
    print y.read()
    
except Exception, E:
    print "Status: 500 Unexpected Error"
    print "Content-Type: text/plain"
    print 
    print "url: ", url
    print 
    print "Some unexpected error occurred. Error text was:", E

This script produces the "<urlopen error (11001, 'getaddrinfo 
failed')>".  The openlayers homepage is expected.  My environment 
is Tomcat 6, Apache 2, Win XP, and Python 2.5.  I have my local 
firewall turned off.  Proxy support is enabled, and working, in 
Apache 2.0 (I get the error with Apache Server stopped). I seem to 
be missing something to facilitate the communication between 
python, my network and tomcat.  Any direction or solution is 
greatly appreciated.

Thank you,
Josh




More information about the Python-list mailing list