470,590 Members | 2,525 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,590 developers. It's quick & easy.

mod_python, COM, on win2k3 server

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.


May 21 '06 #1
1 1394
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\apache.py", line 299, in
result = object(req)

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

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

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

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

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

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

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

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

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

May 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Julien Cigar | last post: by
1 post views Thread by Gregory (Grisha) Trubetskoy | last post: by
1 post views Thread by treelife | last post: by
4 posts views Thread by John Salerno | last post: by
reply views Thread by Gregory (Grisha) Trubetskoy | last post: by
7 posts views Thread by Ben Finney | last post: by
10 posts views Thread by Vincent Delporte | last post: by
reply views Thread by Gregory (Grisha) Trubetskoy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.