[Zope3-dev] Loading and running ZX3 from a zip file

Peter Mayne PeterMayne at ap.spherion.com
Wed Jan 5 20:31:45 EST 2005


An idle observation...

We're writing an application that will be run from a CD. ZX3 takes a 
while to load and start from a CD, so we thought we might use Python's 
ability to import from a zip file (PEPs 273 and 302) to cut down the 
amount of bytes to be read from the CD.

The first problem is that there are some .pyd files in ZX3, and Python 
won't import those. This was solved by using Thomas Heller's 
zipextimporter that can import .pyd extensions.

So far so good. However, ZX3 then attempts to open various files, 
zope/app/server/schema.xml for instance. Since this file does not exist 
on the filesystem (the path in this case is 
file://///C|/tmp/zope.zip/zope/app/server/schema.xml), ZX3 can't open 
it: end of startup.

After hacking my way through various file opening code replacing 
zope.zip in the path with something else, I eventually get to

     TypeError: 'zope.security.checker.Checker' object is not callable

which is where I stop. :-)

I'm hesitant to call ZX3's inability to load from a zipe file a bug, 
because I don't think such a thing was envisaged. However, is it 
something that might be considered for the (possibly distant) future, or 
  (as I suspect) isn't it worth the trouble? Maybe in the future the PEP 
302 __loader__ attribute could be used.

PJDM
-- 
Peter Mayne
Spherion Technology Solutions
Canberra, ACT, Australia
"I'm after rebellion, I'll settle for lies" - Blue Oyster Cult



More information about the Zope3-dev mailing list