#8377 closed defect (worksforme)
SetEnv PYTHON_EGG_CACHE fails with TracEnvParentDir
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | web frontend/mod_python | Version: | 0.11.2 |
Severity: | normal | Keywords: | verify |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If multiple trac environments are used together with TracEnvParentDir, the changes introduced in r7440 in modpython_frontend.py fail to pick up the SetEnv option for PYTHON_EGG_CACHE, since TracEnvParentDir is checked first to build a default path. If one wants to use the implicit cache path in TracEnvParentDir trac fails too, since the cache is not a trac environment.
Example config:
SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/lib/trac PythonOption TracUriRoot /trac SetEnv PYTHON_EGG_CACHE /var/www/localhost/egg_cache/
The workaround is to use PythonOption PYTHON_EGG_CACHE, but then the ENV code is useless. So either way, the logic has to be cleaned up :)
Attachments (0)
Change History (5)
comment:1 by , 15 years ago
Keywords: | verify added |
---|---|
Milestone: | → 0.12.1 |
comment:2 by , 15 years ago
That's a limitation of embedded mod_python - the process has initialized itself with OS variables from Apache launch, but mod_python can/will never use SetEnv
and PassEnv
directives - they have no effect. So, for anything mod_python, PythonOption
needs to be used.
There isn't anything the Trac project can do about that, and I think at least the TracModPython documentation uses PythonOption
for all request-settings.
'worksforme'?
comment:4 by , 15 years ago
Milestone: | 0.12.1 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Ok, it doesn't look like.
So worksforme: use PythonOption.
What about the SetEnv HTTPS 1
from TracModPython#HTTPSissues, is that also wrong?
comment:5 by , 15 years ago
No, that's right - but it shows up in req.environ
and we read it from there as a per-request option. Which if fine. I should probably be more specific, as what I meant was that any SetEnv
will not affect mod_python itself, and the environment mod_python use to initialize itself and its package loading and so on - the os.environ
mod_python uses must be set before Apache starts, and not part of httpd.conf.
Probably, yes.