I’m trying to use suds in a python Google App Engine application. This is
the traceback:
client = Client(url)
File "/base/data/home/apps/sandbox/test.349741318547153856/suds/client.py",
line 109, in __init__
options.cache = ObjectCache(days=1)
File "/base/data/home/apps/sandbox/test.349741318547153856/suds/cache.py",
line 141, in __init__
location = os.path.join(tmp(), 'suds')
File "/base/python_runtime/python_dist/lib/python2.5/tempfile.py",
line 45, in PlaceHolder
raise NotImplementedError("Only tempfile.TemporaryFile is
available for use")
NotImplementedError: Only tempfile.TemporaryFile is available for use
I tried changing line 109 at client.py:
options.cache = ObjectCache(days=1)
to:
options.cache = None
And it works now but I’m not sure if that can affect something in the
future.
I really appreciate if anybody can help me here.
Thanks in advance.
You can’t write to local files in appengine. Thats why you get that error it’s trying to write a cache of processed WSDL to a temporary file. You will have to not cache or provide an alternate cache mechanism. I am using suds on appengine with a very expensive WSDL file, so I hacked the caching to write the cache on the dev server filesystem and then uploaded the cache, with the deployed code.
I cheated – sort of.
I defined this bit of code in my appengine code. Loaded up the remote command api, ran it locally,
prepopulating the cache. Then I amde sure that cach_location was set correctly in my real appengine code. When you run in the remote_api shell you are not running with the same restrictions that server code is. In fact you don’t even have to run it under the shell, but I tend to do a lot that way.