pywintypes error

koranthala koranthala at gmail.com
Mon Nov 30 10:58:50 EST 2009


Hi,
   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\\pywintypes.py", line
124, in?\n __import_pywin32_system_module__("pywintypes", globals())
[Mon Nov 30 15:13:50 2009] [error] [client 127.0.0.1] File"C:\
\Python24\\Lib\\site-packages\\win32\\lib\\pywintypes.py", line 114,
in__import_pywin32_system_module__\n assert sys.modules[modname]
isold_mod
[Mon Nov 30 15:13:50 2009] [error] [client 127.0.0.1] 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
    else:
        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
globs.
        sys.modules[modname] = old_mod
        globs.update(mod.__dict__)

    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?



More information about the Python-list mailing list