Using httplib2 with Python2.7, OSError: [Errno 38] Function not implemented

Showing 1-3 of 3 messages
Using httplib2 with Python2.7, OSError: [Errno 38] Function not implemented Tencia Lee 12/21/11 10:40 PM
Hello everyone, I am trying to basically duplicate this sample app:

http://code.google.com/p/google-api-python-client/source/browse/#hg%2Fsamples%2Fappengine

and it works fine locally but when deployed I get a 500 error and the following log:

Traceback (most recent call last): File "/base/data/home/apps/s~vbookshelfsearch/2.355551997112030176/main.py", line 34, in <module> from oauth2client.appengine import oauth2decorator_from_clientsecrets File "/base/data/home/apps/s~vbookshelfsearch/2.355551997112030176/oauth2client/appengine.py", line 40, in <module> from client import AccessTokenRefreshError File "/base/data/home/apps/s~vbookshelfsearch/2.355551997112030176/oauth2client/client.py", line 63, in <module> CACHED_HTTP = httplib2.Http('.cache') File "/base/data/home/apps/s~vbookshelfsearch/2.355551997112030176/httplib2/__init__.py", line 1083, in __init__ self.cache = FileCache(cache) File "/base/data/home/apps/s~vbookshelfsearch/2.355551997112030176/httplib2/__init__.py", line 700, in __init__ os.makedirs(self.cache) File "/base/python27_runtime/python27_dist/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 38] Function not implemented: '.cache'


The first thing that happened was it was unable to import httplib2 (even though it's actually included in the google_appengine/lib folder in the Python SDK I downloaded) so I copied the httplib2 directory to my app's directory. Would really appreciate any insight on what this error means and how to fix it. Thanks!
Re: Using httplib2 with Python2.7, OSError: [Errno 38] Function not implemented Anand Mistry 12/23/11 1:34 PM
The mkdir function isn't available in the 2.7 runtime because you can't create files or directories on App Engine (except via the experimental Files API). You'll need to modify the code to either catch the exception and treat it as a write error, or avoid making the call and act appropriately.
Re: Using httplib2 with Python2.7, OSError: [Errno 38] Function not implemented Tencia Lee 12/23/11 7:48 PM
Thanks - for anyone else who might see this problem, I went into oauth2client/client.py, and there's a conditional before the

CACHED_HTTP = httplib2.Http('.cache')

so I commented out the conditional so it uses the other case:

CACHED_HTTP = httplib2.Http()

automatically, and this one does not call makedirs.