Need help with COMObject for Zope

Toby Dickenson mbel44 at
Fri Apr 28 04:05:05 EDT 2000

tseaver at (Tres Seaver) wrote:

>>Add the 2 lines:
>>import pythoncom


>>before your code, and it will almost certainly work.
>>The Zope guys should document this fairly well.  Note that Zope is almost
>>certainly initializing COM on a different thread than your code is being
>>called on (hence you see this message) - but there are some serious
>>implications with COM and threading.  

Yes, this is definitely a problem. Zope products can't always play by
the apartment threading rules, therefore you _must_ call

>I dont believe you will hit them here, but someone will sometime :-)
>We have a bug in the Collector on the COMObject project for this issue:
>The bug page has three distinct workarounds:  one is essentially what
>Mark posted (it has some ugly issues, but will work, slowly, for most code);

>one requires hooking the thread creation to perform the CoInitialize() then;

....and works for all code ;-)

Toby Dickenson
tdickenson at

More information about the Python-list mailing list