I get the following error when trying to get urllib2 url in google engine:
error: An error occured while connecting to the server: Unable to fetch URL: http:
This is the code that calls urllib2's public read methods:
def get(self):
self.write(urllib2.urlopen("http://www.google.com").read())
self.render_index()
Nothing unusual, just calling the library inside the main handler to output the extracted text.
My computer resolves DNS correctly. I can use the urllib2 library from the python interpreter, successfully getting the urls.
The deployed code launched from google servers works as intended, it is something with my local environment, but I can not find what it is.
I also tried using urlfetch from gae with similar results (the same getaddrinfo failed)
I switched to Google DNS a few days before working with the urllib2 library, but switched to ISP if DNS did not work.
EDIT: IP- URL-:
self.write(urllib2.urlopen("http://173.194.42.34").read())
!