[python-win32] Dispatch error 'CoInitialize has not been called'
Bob Gailer
bgailer at alum.rpi.edu
Fri Dec 29 23:00:29 CET 2006
Tim Golden wrote:
>>> [Bob Gailer]
>>>
>> Yeah, but when I said it was working, it was working in the server!
>> Wednesday AM just fine. Wednesday afternoon suddenly not working fine. I
>> swear I didn't change anything!
>>
>> Is there some way my program can introspect? to see if it is in a thread?
>>
>
> It's a bit clunky, but I think you can do this:
>
> <code>
> import threading
> import pythoncom
>
> if threading.currentThread ().getName () <> 'MainThread':
> pythoncom.CoInitialize ()
>
I had my code return threading.currentThread().getName() and it is
"H:\apache2triad". I'm not sure what that tells me, except that it is in
a thread. I think I have a lot to learn about Apache and mod_python.
>
--
Bob Gailer
510-978-4454
More information about the Python-win32
mailing list