[Zope] - ZServer and RedHat

Amos Latteier amos@aracnet.com
Tue, 26 Jan 1999 10:18:01 -0800


At 12:38 PM 1/26/99 -0500, Michel Pelletier wrote:
>I spent a good bit of this morning playing with ZServer on my RedHat 5.2
>machine.
>The good news is it's working and it's fast, but there are some trickies
>that
>should be noted.

Well that's what alpha testing if for ;-)

>I edited the start.py file to use the python that came with RH.  That
>didn't work
>because the default Python for RH stupidly doesn't have threads enabled.

Yes, this is annoying.

>So... I edited the start.py again to use the Python that comes with the
>linux binary distribution of Zope, and that bombs because we don't ship
>the FCNTL module with our Python, which medusa uses (in
>medusa/asyncore.py).

Actually I don't think that this is true. There should be a FCNTL.py in
'lib/python1.5/plat-linux2'.

You may not be seeing it because either your PYTHONHOME and/or your Python
path may not be set correctly. See the 'start' shell script that comes with
Zope for an example of how to set the PYTHONHOME before firing up Python.

We should probably include a similar shell script with ZServer.

>..and then re-edited the start.py file to go back to the (new) system
>python.
>Everything started up fine, but when I tried to hit the HTTP server
>I got an
>'unhandled exception in thread' error, cPickle choked on reading the
>Zope
>database file.  Brian said this is because I installed ZServer *over* an
>existing
>Zope, and that the python that comes with Zope uses a different cPickle
>format.
>The solution is either to recompile my new Python (again) with the
>different
>cPickle format enabled, or to delete my database files and let Zope make
>new
>ones, using the new format.  I chose the latter.  Moving 'var/Data.bbb*'
>into
>an old directory, firing up ZServer/start, and it worked!

Yes, this is an another annoying problem that has bitten me once before. It
should probably be in the FAQ. As I recall the problem is this (please
correct me if I'm wrong):

cPickle can be compiled to use binary pickles. The standard Python cPickle
is not configured to use them. The cPickle that ships with Zope is.
Unfortunately cPickle won't even *read* binary pickles unless it is
compiled with the binary pickle option. Thus if you create a bobobase using
the Python that ships with Zope and then switch to using another copy of
Python with the same bobobase, there is a good chance that the cPickle in
the new Python installation will refuse to read the binary pickles in the
old bobobase.

I believe that newer versions of cPickle should be able to read binary
pickles even if they won't write them, which will solve the problem. In the
mean time, you should probably stick with the same copy of Python. If you
need to switch from Zope's Python to another Python, you may need to
recompile cPickle.

There may be other solutions to this problem. For example, there may be a
way to convert a bobobase from binary to non-binary pickles, though I've
never done this...

Thanks for kicking the tires on ZServer!

-Amos