Home > Admin | Server > mod_python 3.3.1 + ViewVC 1.0.4を動かすためのhandler修正

mod_python 3.3.1 + ViewVC 1.0.4を動かすためのhandler修正


mod_python 3.3.1になってからViewVCがうまく動いてくれません。こんなエラーが出ちゃいます。

Phase:          'PythonHandler'
Handler:        'handler'
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)
  File "/_some_path_/viewvc/bin/mod_python/handler.py", line 24, in handler
    module = apache.import_module(module_name, path=[path])
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 296, in import_module
    log, import_path)
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 680, in import_module
    execfile(file, module.__dict__)
  File "/_some_path_/viewvc/bin/mod_python/viewvc.py", line 45, in ?
    import viewvc
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 991, in load_module
    return _global_modules_cache.import_module(self.__file)
  File "/usr/lib/python2.3/site-packages/mod_python/importer.py", line 488, in import_module
    assert(file != parent_info.file), "Import cycle in %s." % file
AssertionError: Import cycle in /_some_path_/viewvc/bin/mod_python/viewvc.py.

これを解決するには/_some_path_/viewvc/bin/mod_python/handler.pyのモジュール検索部分を次のように修正。

  try:
    #module = apache.import_module(module_name, path=[path])
    module = apache.import_module(module_name, path)

これで動きます。参考までに /viewvc で見れるようにするためのApache + mod_pythonの設定例は次のとおりです。

<IfModule mod_python.c>
    ScriptAlias /viewvc "/_some_path_/viewvc/bin/mod_python/viewvc.py"
    <Location /viewvc>
        AddHandler mod_python .py
        PythonPath "[r'/_some_path_/viewvc/bin/mod_python']+sys.path"
        PythonHandler handler
        PythonDebug On
        AddDefaultCharset UTF-8
        Options +Includes
    </Location>
</IfModule>
  • 動作確認環境
    • CentOS 4.5
    • Python 2.3.4
    • Apache 2.2.0
    • mod_python 3.3.1
    • ViewVC 1.0.4
    • Subversion 1.4.4

[2008/0510追記] ViewVC 1.0.5でも同じ修正が必要でした。

この記事に関連する別の記事:

  1. mod_python: Failed to create global mutexへの対応 ...
  2. Apache 2.2.x + mod_python ...
  3. ViewVC ...
  4. COOL deploy時のサブアプリケーションのコンポーネント名がまずいかも (解決) ...
  5. Strutsで国際化 ...

コメント:0

コメントフォーム
Remember personal info

トラックバック:0

このエントリーのトラックバックURL
http://jfut.integ.jp/2007/06/10/fix-mod_python-3-3-1-for-viewvc-1-0-4/trackback/
Listed below are links to weblogs that reference
mod_python 3.3.1 + ViewVC 1.0.4を動かすためのhandler修正 from ふたつの川うるおう日記

Home > Admin | Server > mod_python 3.3.1 + ViewVC 1.0.4を動かすためのhandler修正

検索
フィード
メタ情報

Return to page top