473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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.

Thanks,

-d
May 21 '06 #1
1 1510
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
HandlerDispatch
result = object(req)

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

File "C:\Python23\Lib\site-packages\mod_python\publisher.py", line 410, in
publish_object
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
apply_fs_data
return object(**args)

File "E:\http_server\timeslips\index.py", line 84, in index
rtn.append(ts_widget.make_employee_picker())

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,
pythoncom.IID_IDispatch)

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

?
May 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Julien Cigar | last post by:
Hello, I'm using mod_python 3.1.3 with Apache 2.0.54 on a Debian box with the publisher handler and the Clearsilver template engine, and from time to time apache returns an 500 error code...
1
by: Gregory (Grisha) Trubetskoy | last post by:
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.2.7 release of mod_python. Mod_python 3.2.7 is considered a stable release, suitable for production...
1
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req):...
4
by: John Salerno | last post by:
I get this internal error message when I try to access a PSP page: "Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module not included in the server configuration" So it...
0
by: Gregory (Grisha) Trubetskoy | last post by:
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.2.10 release of mod_python. Mod_python 3.2.10 is considered a stable release, suitable for production...
1
by: boney | last post by:
hello All, I am totally unknown to python language.. i need to install mod_python to embed python interpreter with the Apache server, in order to use Trac with Apache Web Server i am using...
7
by: Ben Finney | last post by:
Howdy all, I'm working on a web application that is starting to gain a lot of back-end code written in Python. However, all the current interface code is written in legacy PHP. I'd like to...
10
by: Vincent Delporte | last post by:
Hi I'm still a newbie when it comes to web applications, so would like some help in choosing a solution to write apps with Python: What's the difference between using running it through...
0
by: Gregory (Grisha) Trubetskoy | last post by:
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.3.1 release of mod_python. Mod_python 3.3.1 is considered a stable release, suitable for production...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.