[issue2757] mod_wsgi fails with ImportError

muppetwonder bugs at mercurial.selenic.com
Fri Apr 8 03:17:58 UTC 2011


New submission from muppetwonder <clinton at clearcanvas.ca>:

I acknowledge that I'm not sure whether this is a problem in mercurial or a
problem in mod_wsgi, but decided to post here first.

I am attempting to host my repositories under Apache using the mod_wsgi
extension, but cannot get past the hgweb(config) call in hgweb.cgi. The
experience is unacceptably slow using regular CGI support. 

An exception is thrown: ImportError: DLL load failed: The specified module
could not be found (the excerpt from the log with traceback is below).

NOTE 1: that the hosting works perfectly if I don't use mod_wsgi but instead
use Apache's native cgi mechanism.

NOTE 2: a simple test application script that just outputs 'Hello world!'
*does* work under mod_wsgi; it is only when initialization of hgweb is
included that it fails. 

My system configuration is:

Windows Server 2003 R2, Standard 64-bit edition
Apache 2.2.17, 32-bit
mod_wsgi 3.3 (compiled against python 2.6.2), 32-bit
python 2.6.6, 32-bit
mercurial 1.8.2 python 2.6 package, 32-bit

I have checked that the dependency of mercurial and mod_wsgi on msvcr90.dll
can be satisfied, since it exists in the WinSxS directory, and is loaded
when python is initialized (seen using Process Monitor and Process Explorer).

        Log Excerpt with traceback

mod_wsgi (pid=9452): Target WSGI script
'E:/apache-root/htdocs/HgWeb/hgweb.cgi' cannot be loaded as Python module.
mod_wsgi (pid=9452): Exception occurred processing WSGI script
'E:/apache-root/htdocs/HgWeb/hgweb.cgi'.
Traceback (most recent call last):
  File "E:/apache-root/htdocs/HgWeb/hgweb.cgi", line 30, in <module>
    application = hgweb(config)
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\hgweb\\__init__.py",
line 26, in hgweb
    return hgwebdir_mod.hgwebdir(config, baseui=baseui)
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\hgweb\\hgwebdir_mod.py",
line 61, in __init__
    self.refresh()
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\hgweb\\hgwebdir_mod.py",
line 70, in refresh
    u = ui.ui()
  File "C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\ui.py", line
35, in __init__
    for f in util.rcpath():
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\demandimport.py",
line 75, in __getattribute__
    self._load()
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\demandimport.py",
line 47, in _load
    mod = _origimport(head, globals, locals)
  File "C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\util.py", line
576, in <module>
    from windows import *
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\demandimport.py",
line 85, in _demandimport
    return _origimport(name, globals, locals, fromlist)
  File "C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\windows.py",
line 21, in <module>
    posixfile.__doc__ = osutil.posixfile.__doc__
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\demandimport.py",
line 75, in __getattribute__
    self._load()
  File
"C:\\WebBin\\Python266\\lib\\site-packages\\mercurial\\demandimport.py",
line 47, in _load
    mod = _origimport(head, globals, locals)
ImportError: DLL load failed: The specified module could not be found.

----------
messages: 16018
nosy: muppetwonder
priority: urgent
status: unread
title: mod_wsgi fails with ImportError
topic: hgweb

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2757>
____________________________________________________


More information about the Mercurial-devel mailing list