Following the Google AppEngine AuthSub docs I get this error:
AttributeError at /admin/ 'module' object has no attribute 'socket' Request Method: GET Request URL: http://www.host.com/admin/ Exception Type: AttributeError Exception Value: 'module' object has no attribute 'socket' Exception Location: /base/python_dist/lib/python2.5/httplib.py in connect, line 1133 Python Executable: /base/ Python Version: 2.5.2 Python Path: ['/base/python_lib/versions/1', '/base/python_dist/lib/python25.zip', '/base/python_dist/lib/python2.5/', '/base/python_dist/lib/python2.5/plat-linux2', '/base/python_dist/lib/python2.5/lib-tk', '/base/python_dist/lib/python2.5/lib-dynload', '/base/data/home/apps/host/1.44/'] Server time: Mon, 1 Sep 2008 09:51:07 +0000
This happens both on the production deploy and on the local host. The answer is not obvious in a google search, but is found here. Looks like gdata relies on httplib which is replaced by urlfetch on AppEngine. The solution looks like:
import gdata.service import gdata.urlfetch # Use urlfetch instead of httplib gdata.service.http_request_handler = gdata.urlfetch
2 comments:
In version 1.2.0 and later of the gdata-python-client lib, the procedure to adapt the client to App Engine looks slightly different. To use a GDataService object on App Engine you do:
import gdata.service
import gdata.alt.appengine
...
client = gdata.service.GDataService()
gdata.alt.appengine.run_on_appengine(client)
(more details in this article: http://code.google.com/appengine/articles/gdata.html )
Thanks for posting this Jonathan, this blog post has been a great resource.
Jeff--thanks for the pointer! I'll be making a new post shortly covering my updates.
Post a Comment