From: koranthala on
When I try to use Django with Apache and mod_python, I am facing an
issue. Since this is a very usual configuration, I hope this issue is
already solved.
My web sites fail with the following error :

"C:\\Python24\\Lib\\site-packages\\win32\\lib\\", line
124, in?\n __import_pywin32_system_module__("pywintypes", globals())
[Mon Nov 30 15:13:50 2009] [error] [client] File"C:\
\Python24\\Lib\\site-packages\\win32\\lib\\", line 114,
in__import_pywin32_system_module__\n assert sys.modules[modname]
[Mon Nov 30 15:13:50 2009] [error] [client] AssertionError

I checked the code in pywintypes and it is a sure assertion error:

old_mod = sys.modules[modname]
# Python can load the module
mod = imp.load_dynamic(modname, found)
# Check the sys.modules[] behaviour we describe above is true...
if sys.version_info < (3,0):
assert sys.modules[modname] is old_mod
assert mod is old_mod
assert sys.modules[modname] is not old_mod
assert sys.modules[modname] is mod
# as above - re-reset to the *old* module object then update
sys.modules[modname] = old_mod

I have python 2.4 so, it goes to the first check and fails. Has
anyone else faced this issue? How to solve the same?