I've found several other threads by people who updated from RHEL 5 to RHEL
6, only to encounter *AttributeError: 'Translator' object has no attribute
'setup**'*
This post is for the next person who hits this one ;-)
- Started with working 0.11 Trac running on RHEL5 with mod_python
- Follow the Trac Migration page to move it onto a brand new RHEL6 system
with Trac 0.12 installed from EPEL6.
- Read up on Trac & mod_wsgi and configure. I used the method that creates
a /tmp/deploy folder which you then move into your main site folder. The deploy
folder has cgi-bin and htdocs, trac.wsgi is in cgi-bin (unlike some of the
examples which assume that trac.wsgi is in a folder named 'apache')
At this point running "tracd --port 8000 /my/path" works fine, but through
httpd
it fails
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/trac/web/api.py", line 446, in
send_error
data, 'text/html')
... 10-12 lines omitted ...
File "/usr/lib/python2.6/site-packages/trac/web/chrome.py", line 802, in
<lambda>
Translator(translation.get_translations()).setup(template))
AttributeError: 'Translator' object has no attribute 'setup'
Genshi-0.5.1 is installed in /usr/lib64/python2.6/site-packages/ but
Genshi-06 is installed in /usr/lib/python2.6/site-packages
mod_wsgi lets you append to the PythonPath, but I needed to insert, soinstead I
tweaked the trac.wsgi file:
import os
*import sys
sys.path.insert(0,'/usr/lib/python2.6/site-packages/Genshi-0.6-py2.6.egg')*
def application(environ, start_request):
if not 'trac.env_parent_dir' in environ:
environ.setdefault('trac.env_path', '/data/system/trac/ondmain')
if 'PYTHON_EGG_CACHE' in environ:
os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
elif 'trac.env_path' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_path'], '.egg-cache')
elif 'trac.env_parent_dir' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_parent_dir'], '.egg-cache')
from trac.web.main import dispatch_request
return dispatch_request(environ, start_request)
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.