[Zope3-dev] guessing where zope.conf is
Steve Alexander
steve at z3u.com
Tue Jun 15 14:09:06 EDT 2004
Hi folks,
I'm making myself a kind of customized "zope 3 instance home" for a
project I'm working on. I've run into an inconvenience in how the
system finds a zope.conf or zope.conf.in file.
In src/zope/app/server/main.py, the code looks for a zope.conf file in
the directory:
dir = os.path.normpath(
os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir, os.pardir))
That's basically $(zope.app.server.main.__file__)/../../../../zope.conf
The problem is that it is looking for a zope.conf file (which belongs in
"server instance space") by starting off from
zope.app.server.main.__file__ (which is in "python library space"). The
guess will be wrong a lot of the time.
I propose that zope.app.server.main should not try to guess where config
files live, but that it should always be passed a place to look
explicitly. The z3.py start script and any other start scripts should
be responsible for working out what directory to look in, and passing
this to zope.app.server.main.
--
Steve Alexander
More information about the Zope3-dev
mailing list