Description of problem: The latest Python 2.5 and mod_python in Fedora 7 surfaced an import cycle error in ViewVC 1.0.4. Version-Release number of selected component (if applicable): Fedora 7 ViewVC 1.0.4 Python 2.5 mod_python 3.3.1 How reproducible: Every time. Steps to Reproduce: 1. On Fedora 7 system, enable viewvc with default configuration in /etc/httpd/conf.d/viewvc.conf and /etc/viewvc/viewvc.conf 2. Webpage at http://yourhost/viewvc will show Internal Server Error Actual results: In error_log, with debug enabled, you will receive following: Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target\n result = object(arg) [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/viewvc/bin/mod_python/handler.py", line 24, in handler\n module = apache.import_module(module_name, path=[path]) [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 296, in import_module\n log, import_path) [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 680, in import_module\n execfile(file, module.__dict__) [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/viewvc/bin/mod_python/viewvc.py", line 45, in <module>\n import viewvc [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 991, in load_module\n return _global_modules_cache.import_module(self.__file) [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 488, in import_module\n assert(file != parent_info.file), "Import cycle in %s." % file [Sat Jun 02 12:32:05 2007] [error] [client 69.134.94.157] AssertionError: Import cycle in /usr/lib/python2.5/site-packages/viewvc/bin/mod_python/viewvc.py. Expected results: ViewVC should work. ;) Additional info: It can be worked around by enabling CGI mode. I switched us to using the CGI. I commented out the mod_python lines in /etc/httpd/conf.d/viewvc.conf and that file has now the following: #Alias /viewvc /usr/lib/python2.5/site-packages/viewvc/bin/mod_python/viewvc.py Alias /viewvc /usr/lib/python2.5/site-packages/viewvc/bin/cgi/viewvc.cgi Alias /viewvc-static /usr/share/viewvc/templates/docroot <Directory /usr/lib/python2.5/site-packages/viewvc/bin/mod_python> # AddHandler python-program .py AddHandler cgi-script .py PythonHandler handler PythonPath "sys.path+['/usr/lib/python2.5/site-packages/viewvc/bin/mod_python']" Order allow,deny Allow from all AuthType Basic AuthName "Authorization Realm" AuthUserFile /home/svn-repositories/.htpasswd Require valid-user </Directory> In addition, I had to put a .htaccess file with "Options +ExecCGI" in "/usr/lib/python2.5/site-packages/viewvc/bin/cgi/" and also put "AllowOverride None +ExecCGI" for the "Directory /" stanza in /etc/httpd/conf/httpd.conf
I can replicate this. Working on it...
Please try -2, now available in Koji: http://koji.fedoraproject.org/koji/buildinfo?buildID=7852
There is another work around with mod_python: In the directory /usr/lib/python2.5/site-packages/viewvc/bin/mod_python, the viewvc.py file has to be renamed into viewvc_cgi.py (or something like that). As I understand it, the viewvc.py, normally restricted to the CGI usage, is in the way of the mod_python access. When Apache is restarted, it works. Denis
That RPM worked. Took me a minute to realize there's a little migration step as viewvc.conf got created as viewvc.conf.rpmnew and the file was renamed to -mp, but other than that, works.
Very well. Thank you for testing! Once this gets fixed upstream, we'll roll a new version for a more permanent fix.
Now available from updates-testing. If nobody complains, I'll push to updates tomorrow.
It seems to work for me. Thanks! Denis
Requested push to updates. Thanks everyone for testing!