[mod_python] Problem storing objects in session

Graham Dumpleton graham.dumpleton at gmail.com
Tue Apr 17 01:22:47 EDT 2007


On 17/04/07, Michael Harrison <mlh496 at gmail.com> wrote:
> I can store objects in session locally, but not on my production server.

What is the actual error you are getting?

> Here are my computer specs:
>
> Local: Windows, Apache 2.2, ModPython 3.3.1
>  Server: Linux, Apache 2.2, ModPython 3.3.1
>
> Reading through past discussions, I understand there was a change in
> ModPython 3.2 that did cause pickling problems when saving a session with
> objects in it.  Has this been fixed?  If so, then apparently I need to tweak
> my Apache configuration (not sure how).  If not, I can't find any discussion
> that mentions this fact.

The changes started in 3.2 with mod_python.publisher and also applying
to basic handlers in 3.3, impose certain limitations as to what you
can pickle when a file system based session database is used. This is
documented at:

  http://www.dscpl.com.au/wiki/ModPython/Articles/IssuesWithSessionObjects

When running Windows an in memory session database is used and the
limitations do not apply. That is most likely why your code will not
port to Linux.

The only solution is to limit what data types you are pickling. This
of course is total speculation as you haven't said what the actual
error messages are that you are seeing in the error page or in your
logs.

Note that the limitations will not be removed unless the whole ability
to reload modules is given up.

Graham


More information about the Mod_python mailing list