plone / plone.recipe.zope2instance

zc.buildout recipe to setup and configure a Zope 2 instance.
https://pypi.org/project/plone.recipe.zope2instance
6 stars 23 forks source link

wsgi=off -> FileNotFoundError: [Errno 2] No such file or directory: '/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/off' #115

Open zopyx opened 5 years ago

zopyx commented 5 years ago

plone.recipe.zope2instance = 6.2.1, Plone 5.2

Setting wsgi=off generates a messy installation:

/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/Zope-4.0b10-py3.7.egg/Zope2/Startup/serve.py:306: DeprecationWarning: 'U' mode is deprecated
Traceback (most recent call last):
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/parts/wsgi.py/bin/interpreter", line 307, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/Zope-4.0b10-py3.7.egg/Zope2/Startup/serve.py", line 219, in <module>
    sys.exit(main() or 0)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/Zope-4.0b10-py3.7.egg/Zope2/Startup/serve.py", line 216, in main
    return command.run()
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/Zope-4.0b10-py3.7.egg/Zope2/Startup/serve.py", line 178, in run
    relative_to=base, global_conf=vars)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/Zope-4.0b10-py3.7.egg/Zope2/Startup/serve.py", line 211, in loadserver
    server_spec, name=name, relative_to=relative_to, **kw)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/PasteDeploy-2.0.1-py3.7.egg/paste/deploy/loadwsgi.py", line 261, in loadserver
    return loadobj(SERVER, uri, name=name, **kw)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/PasteDeploy-2.0.1-py3.7.egg/paste/deploy/loadwsgi.py", line 277, in loadobj
    global_conf=global_conf)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/PasteDeploy-2.0.1-py3.7.egg/paste/deploy/loadwsgi.py", line 302, in loadcontext
    global_conf=global_conf)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/PasteDeploy-2.0.1-py3.7.egg/paste/deploy/loadwsgi.py", line 323, in _loadconfig
    loader = ConfigLoader(path)
  File "/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/eggs/PasteDeploy-2.0.1-py3.7.egg/paste/deploy/loadwsgi.py", line 399, in __init__
    with open(filename) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ajung/sandboxes/onkopedia_buildout-plone5-python3.7/off'
zopyx commented 5 years ago

The correct way to use the ZServer is to omit the wsgi option alltogether rather than using wsgi=off ...perhaps the documentation should be more explicit about how to switch between ZServer vs. WSGI

pbauer commented 5 years ago

That seems like a bug in https://github.com/plone/plone.recipe.zope2instance/blob/master/src/plone/recipe/zope2instance/recipe.py#L117

Since @datakurre is working on porting ZServer to Python 3 it makes sense to keep the option wsgi = off even in Python 3 since in the future you could be able to use eitehr wsgo or ZServer in Python 3. Until then plone.recipe.zope2instance should ignore the setting when running in Python 3.