path = os.path.join(os.getcwd(), 'applications', 'default', 'modules')
word_set_a = pickle.load(open(os.path.join(path, 'word_set_a.txt'),
'r'))
But I am getting the following error:
Traceback (most recent call last):
File "/base/data/home/apps/hillmanwork/1.338501969210326694/gluon/
restricted.py", line 173, in restricted
exec ccode in environment
File "/base/data/home/apps/hillmanwork/1.338501969210326694/
applications/default/controllers/boggle.py:findWords", line 18, in
<module>
File "/base/data/home/apps/hillmanwork/1.338501969210326694/gluon/
globals.py", line 96, in <lambda>
self._caller = lambda f: f()
File "/base/data/home/apps/hillmanwork/1.338501969210326694/
applications/default/controllers/boggle.py:findWords", line 6, in
findWords
File "/base/data/home/apps/hillmanwork/1.338501969210326694/
applications/default/modules/pyBoggle.py", line 88, in <module>
word_set_a = pickle.load(open(os.path.join(path,
'word_set_a.txt'), 'r'))
File "/base/python_dist/lib/python2.5/pickle.py", line 1363, in load
return Unpickler(file).load()
File "/base/python_dist/lib/python2.5/pickle.py", line 852, in load
dispatch[key](self)
File "/base/python_dist/lib/python2.5/pickle.py", line 1084, in
load_global
klass = self.find_class(module, name)
File "/base/python_dist/lib/python2.5/pickle.py", line 1117, in
find_class
__import__(module)
ImportError: No module named __builtin__
Everything works just fine on the local test server, but once upload I
have not such luck.
Are there limitations with the pickle module that I am not aware of?
how is the variable 'path' created? since App Engine executes in a
restricted environment, you may not have access to the necessary
files. a call to os.path.join() should have a flavor of
os.path.join(os.path.dirname(__file__), ...
pickle should be pretty much as you would expect except that it's
really "cPickle," as stated in the docs:
http://code.google.com/appengine/kb/general.html
http://code.google.com/appengine/docs/python/runtime.html
best regards,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
http://corepython.com
wesley.j.chun : we...@google.com
developer relations, google app engine
The path variable is correct - I didn't need to change it to get to my
files. The problem was with trying to unpickle. Not sure why, but I
did get things working by ditching the pickle approach.
Just got it working a few hours ago -
Thanks for your response.
On Dec 17, 2:25 am, Wesley Chun <w...@google.com> wrote:
> scott,
>
> how is the variable 'path' created? since App Engine executes in a
> restricted environment, you may not have access to the necessary
> files. a call to os.path.join() should have a flavor of
> os.path.join(os.path.dirname(__file__), ...
>
> pickle should be pretty much as you would expect except that it's
> really "cPickle," as stated in the docs:http://code.google.com/appengine/kb/general.htmlhttp://code.google.com/appengine/docs/python/runtime.html
>
> best regards,
> -- wesley
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "Core Python Programming", Prentice Hall, (c)2007,2001
> "Python Fundamentals", Prentice Hall, (c)2009
> http://corepython.com
>
> wesley.j.chun : w...@google.com
If pickle is really cPickle, then why are the cPickle specific
features not available?
On Dec 17, 1:25 am, Wesley Chun <w...@google.com> wrote:
> scott,
>
> how is the variable 'path' created? since App Engine executes in a
> restricted environment, you may not have access to the necessary
> files. a call to os.path.join() should have a flavor of
> os.path.join(os.path.dirname(__file__), ...
>
> pickle should be pretty much as you would expect except that it's
> really "cPickle," as stated in the docs:http://code.google.com/appengine/kb/general.htmlhttp://code.google.com/appengine/docs/python/runtime.html
>
> best regards,
> -- wesley
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "Core Python Programming", Prentice Hall, (c)2007,2001
> "Python Fundamentals", Prentice Hall, (c)2009
> http://corepython.com
>
> wesley.j.chun : w...@google.com
> > Are there limitations with the pickle module that I am not aware of?- Hide quoted text -
>
> - Show quoted text -