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.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 : [email protected]
developer relations, google app engine



On Wed, Dec 16, 2009 at 7:18 PM, Scott <[email protected]> wrote:
> I am trying to execute the following code:
>
> 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?

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to