Not Implemented Error in Django ,Twitter Api in Google appengine

221 views
Skip to first unread message

sachin palde

unread,
Dec 24, 2011, 9:34:05 AM12/24/11
to Google App Engine
I am getting

NotImplementedError at /login/authenticated
Only tempfile.TemporaryFile is available for use
when i use twitter api to access timetine after authorizing user by
oauth..
plz help...

Trace of error is as follows:

Environment:

Request Method: GET
Request URL:
http://testapptwit.appspot.com/login/authenticated?oauth_token=MCnfvxsAsXZkRwCVxyFJa2jC3563SUi00h7wtr9ewJg&oauth_verifier=S86JDBYybV6qZVI3NoP0uAsXB0pGXI8FryxH2mhx0M
Django Version: 1.2.5
Python Version: 2.5.2
Installed Applications:
['twit.twitt']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.middleware.doc.XViewMiddleware')


Traceback:
File "/base/python_runtime/python_lib/versions/third_party/django-1.2/
django/core/handlers/base.py" in get_response
100. response = callback(request,
*callback_args, **callback_kwargs)
File "/base/data/home/apps/s~testapptwit/1.355606297548109607/twit/
twitt/views.py" in authen
64. api=twitter.Api()
File "/base/data/home/apps/s~testapptwit/1.355606297548109607/
twitter.py" in __init__
2195. self.SetCache(cache)
File "/base/data/home/apps/s~testapptwit/1.355606297548109607/
twitter.py" in SetCache
3464. self._cache = _FileCache()
File "/base/data/home/apps/s~testapptwit/1.355606297548109607/
twitter.py" in __init__
3814. self._InitializeRootDirectory(root_directory)
File "/base/data/home/apps/s~testapptwit/1.355606297548109607/
twitter.py" in _InitializeRootDirectory
3874. root_directory = self._GetTmpCachePath()
File "/base/data/home/apps/s~testapptwit/1.355606297548109607/
twitter.py" in _GetTmpCachePath
3870. return os.path.join(tempfile.gettempdir(),
cache_directory)
File "/base/python_runtime/python_dist/lib/python2.5/tempfile.py" in
PlaceHolder
45. raise NotImplementedError("Only tempfile.TemporaryFile is
available for use")

Exception Type: NotImplementedError at /login/authenticated
Exception Value: Only tempfile.TemporaryFile is available for use

timh

unread,
Dec 26, 2011, 8:12:12 PM12/26/11
to google-a...@googlegroups.com
The stacktrace is telling you what is going on.

return os.path.join(tempfile.gettempdir(), cache_directory) 
 raise NotImplementedError("Only tempfile.TemporaryFile is available for use")  

As you already know you can't write to the filesystem in appengine, so 
having a function in the tempfile module that starts to play with the filesystem isn't going to work
so that lib has been replaced in the appengine runtime, with all of the non functioning methods/functions
changed to raise NotImplementedError.

This means out of the box (or with your specific use) of the twitter.py won't run on appengine.

Have a look through the groups here, people have had the same problem in the past, and 
have probably worked out how to access twitter api without creating temporary files.

T
Reply all
Reply to author
Forward
0 new messages