Thanks for the response.
The symptom I was seeing suggested that while a thread was processing one event, it was being re-entered. Some additional Investigation revealed that the apparent problem was caused by the event handler terminating before it was finished when it tried to reference the IE.Document.ReadyState attribute. At the time, the document was still in the process of arriving and the COM Document object did not exist. This in turn caused event processing in Python to terminate without releasing the Mutex. I've removed the reference to the Document.ReadyState and the problem is corrected. Richard Bell schrieb: > I'm working on an application that does some IE automation via the COM > interface. I'm running in a free thread model, sys.coint_flags = 0, > and starting IE with > win32.com.client.DispatchWIthEvents("InternetExplorer.Application", > event_handler_class). Events are arriving as revealed by print > statements in the event handling routines. Unfortunately, testing > suggest that the event handling routines are being reentered (a win32 > mutex can not be got because the event routines were reentered BEFORE it was released). > In a free-threaded apartment you must be prepared to receive events in different threads. So I think it is not forbidden that event handlers are reentered. IMO this is most easily fixed by using an STA instead, if you can live with that.
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32