[Twisted-Python] adbapi,adodbapi and pythoncom.CoInitialize()

Craig H. Anderson craig at coot.net
Mon Jun 14 19:47:45 EDT 2004


I would like to use adbapi with the com based adodbapi.
I found that the connect call hangs unless I add a call
to pythoncom.CoInitialize(). 

I guess I'm now the tester for using adbapi and adodbapi on
windows. 

I found a reference to the problem at:
http://devnulled.com/archives/python.php 

 

For a crude test I added pythoncom.CoInitialize()
when a new connection is made in
twisted.enterprise.adbapi.ConnectionPool.connect()
The connection and sql query then run successfully. 

#
import pythoncom
import sys 

sys.coinit_flags = 0
pythoncom.CoInitialize()
[ COM code here... ]
pythoncom.CoUninitialize()




More information about the Twisted-Python mailing list