Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > mod_python, COM, on win2k3 server

Thread Tools

mod_python, COM, on win2k3 server

Posts: n/a
I have an application that runs on mod_python/apache using the publisher
handler. It uses an access db as the backend and connects via ADO. In a
test environment on XP it runs fine, but when on a win2k3 server it will
load one page, but all subsequent page loads throw a
pythoncom.CoInitializeEX error until I restart the apache.

Presumably, this is a threading issue, but I am not sure what the best
approach to fixing it is. Should I simply wrap all COM calls with
pythoncom.CoInitialize/pythoncom.CoUninitialize calls, or is this somethig
that needs to be done at a lower level.

This is mod_python 3.2, Python 2.3.5, apache2.0.*, win2k3, ado 2.8, and the
server has 2 processors in case that matters.



Reply With Quote
Posts: n/a
Some details, and this is weirder than I thought.

It is working fine with internet explorer or mozilla as the client, but only
crashes with Firefox. Moreover, even while firefox is getting errors, IE
stilll works fine.

The error I get is:

Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

File "C:\Python23\Lib\site-packages\mod_python\", line 299, in
result = object(req)

File "C:\Python23\Lib\site-packages\mod_python\", line 213, in
published = publish_object(req, object)

File "C:\Python23\Lib\site-packages\mod_python\", line 410, in
return publish_object(req,util.apply_fs_data(object, req.form, req=req))

File "C:\Python23\Lib\site-packages\mod_python\", line 439, in
return object(**args)

File "E:\http_server\timeslips\", line 84, in index

File "C:\Python23\lib\site-packages\ecptimeslips\", line 128,
in make_employee_picker
rs = win32com.client.Dispatch("ADODB.Recordset")

File "C:\Python23\Lib\site-packages\win32com\client\", line 95,
in Dispatch
dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userN ame,clsctx)

File "C:\Python23\Lib\site-packages\win32com\client\", line 91,
in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)

File "C:\Python23\Lib\site-packages\win32com\client\", line 79,
in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,

com_error: (-2147221008, 'CoInitialize has not been called.', None, None)


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using win2k3 std r2 32 bit license to install win2k3 std r2 64 bit Windows 64bit 0 01-22-2008 08:53 PM
Migrating Shares and NTFS Permissions from Win2k Server to Win2k3 Server JustMe Computer Support 4 07-19-2006 11:52 AM
Win2k3, IIS6, ASP.Net - Server Application Unavailable =?Utf-8?B?TmlyYmhv?= ASP .Net 4 05-10-2005 09:48 PM
What process is ASP.NET on a Win2K3 Web Server?? Eidolon ASP .Net 4 05-12-2004 12:51 PM
will there be a win2k3 server resource kit? pheonix1t MCSE 3 10-10-2003 05:01 AM