Commit e36bd5b3 authored by Hanno Schlichting's avatar Hanno Schlichting

Protect against non-existing zope.conf path and products directories. This...

Protect against non-existing zope.conf path and products directories. This makes it possible to run a Zope instance without a Products or lib/python directory.
parent d69d9e60
......@@ -9,6 +9,10 @@ Zope Changes
Restructuring
- Protect against non-existing zope.conf path and products directories.
This makes it possible to run a Zope instance without a Products or
lib/python directory.
- updated to ZODB 3.8.1
- Moved exception MountedStorageError from ZODB.POSExceptions
......
......@@ -184,9 +184,10 @@ def root_handler(config):
for k,v in config.environment.items():
os.environ[k] = v
# Add directories to the pythonpath; always insert instancehome/lib/python
# Add directories to the pythonpath
instancelib = os.path.join(config.instancehome, 'lib', 'python')
if instancelib not in config.path:
if os.path.isdir(instancelib):
config.path.append(instancelib)
path = config.path[:]
path.reverse()
......@@ -195,10 +196,10 @@ def root_handler(config):
# Add any product directories not already in Products.__path__.
# Directories are added in the order they are mentioned
# Always insert instancehome.Products
instanceprod = os.path.join(config.instancehome, 'Products')
if instanceprod not in config.products:
if os.path.isdir(instanceprod):
config.products.append(instanceprod)
import Products
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment