AttributeError: 'module' object has no attribute 'getaddrinfo'

487 views
Skip to first unread message
Message has been deleted

Akume

unread,
Jun 7, 2008, 8:24:59 PM6/7/08
to Google App Engine
any help would be appreciated.
can't figure out why i'm getting this error.


here's the code
service = gdata.youtube.service.YouTubeService()
service.email = username
service.password = password
service.source = CLIENT_ID
service.developer_key = DEVELOPER_KEY
service.client_id = CLIENT_ID

feed = service.GetMostRecentVideoFeed()


stack trace

Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 499, in __call__
handler.get(*groups)
File "/base/data/home/apps/akume/1.2/main.py", line 33, in get
feed = service.GetMostRecentVideoFeed()
File "/base/data/home/apps/akume/1.2/gdata/youtube/service.py", line
515, in GetMostRecentVideoFeed
return self.GetYouTubeVideoFeed(YOUTUBE_STANDARD_MOST_RECENT_URI)
File "/base/data/home/apps/akume/1.2/gdata/youtube/service.py", line
155, in GetYouTubeVideoFeed
return self.Get(uri,
converter=gdata.youtube.YouTubeVideoFeedFromString)
File "/base/data/home/apps/akume/1.2/gdata/service.py", line 513, in
Get
extra_headers=extra_headers)
File "/base/data/home/apps/akume/1.2/atom/service.py", line 316, in
HttpRequest
connection.endheaders()
File "/base/python_dist/lib/python2.5/httplib.py", line 860, in
endheaders
self._send_output()
File "/base/python_dist/lib/python2.5/httplib.py", line 732, in
_send_output
self.send(msg)
File "/base/python_dist/lib/python2.5/httplib.py", line 699, in send
self.connect()
File "/base/python_dist/lib/python2.5/httplib.py", line 666, in
connect
for res in socket.getaddrinfo(self.host, self.port, 0,
AttributeError: 'module' object has no attribute 'getaddrinfo'

Akume

unread,
Jun 7, 2008, 8:27:01 PM6/7/08
to Google App Engine
forgot to include the libraries

import os
import wsgiref.handlers

import atom
import socket

import gdata.youtube
import gdata.youtube.service

from google.appengine.api import urlfetch
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template

Prateek Malhotra

unread,
Jun 22, 2008, 1:29:17 PM6/22/08
to Google App Engine
Hey, I'm getting this error as well, here's my code:

import os
import wsgiref.handlers

import atom
import socket

import gdata.youtube
import gdata.youtube.service

from google.appengine.api import urlfetch
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
yt_service = gdata.youtube.service.YouTubeService()
query = gdata.youtube.service.YouTubeVideoQuery()
query.vq = 'Funny Test'
query.orderby = 'viewCount'
query.max_results = 50
feed = yt_service.YouTubeQuery(query)

It works fine if i run this code outside of the AppEngine, (minus the
appengine specific imports), any help would be greatly appreciated.

-Prateek

ryan

unread,
Jun 22, 2008, 2:14:10 PM6/22/08
to Google App Engine
hi! you're seeing this error because the socket module is disabled in
app engine. details:

http://code.google.com/appengine/docs/python/sandbox.html
http://code.google.com/appengine/docs/python/purepython.html

you'll have to do a little extra setup to tell the gdata library to
use urlfetch instead of httlib. details:

http://googledataapis.blogspot.com/2008/04/release-hounds-support-for-app-engine.html
http://groups.google.com/group/google-appengine/browse_thread/thread/b7399a91c9525c97
Reply all
Reply to author
Forward
0 new messages