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,10 +184,11 @@ 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:
config.path.append(instancelib)
if os.path.isdir(instancelib):
config.path.append(instancelib)
path = config.path[:]
path.reverse()
for dir in path:
......@@ -195,11 +196,11 @@ 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:
config.products.append(instanceprod)
if os.path.isdir(instanceprod):
config.products.append(instanceprod)
import Products
L = []
......
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