[ZODB-Dev] can't undo with FileStorage and ZEO

Jim Fulton jim@zope.com
Wed, 19 Dec 2001 16:55:46 -0500


I'm getting close to being stuck.

Try cd-ing to your Zope/lib/python directory.

Then run pyhon and typing:

from App.Undo import Prefix

Do you get any errors?

Jim

Andrew Sydelko wrote:
> 
> Jim Fulton wrote:
> > Andrew Sydelko wrote:
> > >
> > > Jim Fulton wrote:
> > > > The Zope App package (or just App.Undo) must be in the Python path of the storage server.
> > >
> > > Umm... I believe it is.
> >
> > Please double check that.
> >
> > > And it's not saying that
> > > it can't find the module App.Undo,
> > > it's complaining
> > > about the "global Prefix" in the module App.Undo.
> >
> > The message says it couldn't get it. It could not get it because
> > it couldn't find the module or because the Prefix class isn't in the
> > module. The only the later is true is that you modified the module.
> >
> > Note that the Undo module imports other things. Maybe your missing one
> > of those.
> >
> >
> > >
> > > Any way to check that it is in the python path of the
> > > server?
> >
> > See if you can undo. ;) Sorry.
> > How about modifying the server to print the PYTHONPATH
> > environment variable.
> 
> with print sys.path in Zope/lib/python/ZEO/start.py I get this:
> 
> ['Zope/lib/python', 'Zope/lib/python/ZEO', '/data/www/Zope.6/lib/python2.1', '/data/www/Zope.6/lib/python2.1/plat-sunos5', '/data/www/Zope.6/lib/python2.1/lib-tk', '/data/www/Zope.6/lib/python2.1/lib-dynload', '/data/www/Zope.6/lib/python2.1/site-packages']
> 
> So, yes, App.Undo is in my PYTHONPATH (it's the first entry above)
> 
> There is no initial PYTHONPATH set when starting the ZEO server.
> 
> In Zope/lib/python/App/Undo.py is the following:
> 
> 201: Globals.default__class_init__(UndoSupport)
> 202:
> 203:
> 204: class Prefix:
> 205:
> 206:     __no_side_effects__=1
> 207:
> 208:     def __init__(self, path):
> 209:         self.value = len(path), path
> 210:
> 211:     def __cmp__(self, o):
> 212:         l,v = self.value
> 213:         rval = cmp(o[:l],v)
> 214:         return rval
> 
> It seems like it might be complaining about this stuff but
> it's all black voodoo magic to me.


--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org