[mod_python] Bug in Windows installation

Eddie Diener eddielee at tropicsoft.com
Sun Apr 25 13:47:33 EST 2004


Mod_python's postinstall script assumes that the Apache key in the Windows registry is in HKLM. However if one installs Apache Web Server on Windows and chooses to install for the current user in order to start Apache manually from the Console Window, the entry is under HKCU. Because of this an exception is thrown in the script when attempting to open HKLM/Apache Group/Apache and the postinstall script never finishes.

Here is the exception trace:

Traceback (most recent call last):
File "H:\UTILIT~1\Python23\Scripts\win32_postinstall.py", line 86, in ?
apachediroptions = getApacheDirOptions()
File "H:\UTILIT~1\Python23\Scripts\win32_postinstall.py", line 45, in
getApacheDirOptions
apachekey = regkey(win32con.HKEY_LOCAL_MACHINE, "Software").childkey("Apache
Group").childkey("Apache")
File "H:\UTILIT~1\Python23\Scripts\win32_postinstall.py", line 34, in
childkey
return regkey(self.key, subkeyname)
File "H:\UTILIT~1\Python23\Scripts\win32_postinstall.py", line 32, in
_init_
self.key = win32api.RegOpenKey(parent, subkeyname)
pywintypes.error: (2, 'RegOpenKeyEx', 'The system cannot find the file
specified.')
Exception exceptions.AttributeError: "regkey instance has no attribute
'key'" in <bound method regkey._del_ of <_main_.regkey instance at
0x011C8468>> ignored
*** run_installscript: internal error 0xFFFFFFFF ***

A workaround is to temporarily duplicate the Apache registry keys from HKCU to HKLM and add the ServerRoot key value, poinitng it to the root directory where Apache is installed. The installing mod_python works OK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.modpython.org/pipermail/mod_python/attachments/20040425/d1025e71/attachment.html


More information about the Mod_python mailing list