Yes, in http://web2py.com/book/default/chapter/09#Custom-Formats, the book 
says:
 

"Not all objects are pickleable, and not all pickled objects can be un-
pickled. It is safe to stick to primitive Python objects and combinations of 
them. Objects that do not contain references to file streams or database 
connections are usually pickleable, but they can only be un-pickled in an 
environment where the classes of all pickled objects are already defined."

 

On Tuesday, May 24, 2011 6:29:10 PM UTC-4, Massimo Di Pierro wrote:

> This does apply to web2py. In fact I believe the book says something 
> like this quote from the article 
>
> "In order to ensure that no strange problems at all are likely to 
> occur, it is suggested that only basic builtin Python types, ie., 
> scalars, tuples, lists and dictionaries, be stored using the "pickle" 
> module from a WSGI application script file. That is, avoid any type of 
> object which has user defined code associated with it." 
>
> Do we know that the new importer does not conflict with the custom 
> mod_wsgi import mechanism described in the article? Has anybody tried 
> trunk with mod_wsgi? 
>
> Massimo 
>
> On May 24, 4:42 pm, Jonathan Lundell <jlun...@pobox.com> wrote: 
> > Reading this makes my head hurt, but I wonder if it might not also apply 
> to web2py:http://code.google.com/p/modwsgi/wiki/IssuesWithPickleModule 
> > 
> > If so, I can think of some ugly workarounds. 
> > 
> > On May 24, 2011, at 12:13 PM, Ross Peoples <ross.p...@gmail.com> wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > For whatever reason, after running for 24 hours, web2py throws an 
> exception when trying to log in. I have to stop web2py, and restart it, then 
> the error goes away and my application starts working again. Any ideas? 
> > 
> > > Traceback (most recent call last): 
> > >   File "/media/psf/Python/web2py/gluon/main.py", line 511, in wsgibase 
> > >     session._try_store_on_disk(request, response) 
> > >   File "/media/psf/Python/web2py/gluon/globals.py", line 469, in 
> _try_store_on_disk 
> > >     cPickle.dump(dict(self), response.session_file) 
> > > PicklingError: Can't pickle <class 'gluon.storage.Storage'>: it's not 
> the same object as gluon.storage.Storage

Reply via email to