[python-win32] COM with timeouts?

2009-02-09 Thread Stephen Hansen
Hi all. I have an application that's controlling Word via COM, and have situations where I'd like to set a timeout on those operations. Word might throw up an error message for example which stalls everything until clicked. In such a case I'd rather just give up, go and kill Word and start over.

Re: [python-win32] ReadDirectoryChangesW

2009-02-09 Thread Eric Blade
> Eric Blade wrote: >> I am getting significantly unreliable results using >> ReadDirectoryChangesW, attempting to use a simplified version of the >> codes that had been presented to me in my last query for help.. > > Eric, can you say what results you *are* getting and in what > way they're unreli

Re: [python-win32] COM with timeouts?

2009-02-09 Thread Tim Roberts
Stephen Hansen wrote: > Hi all. > > I have an application that's controlling Word via COM, and have > situations where I'd like to set a timeout on those operations. Word > might throw up an error message for example which stalls everything > until clicked. In such a case I'd rather just give up, g

Re: [python-win32] COM with timeouts?

2009-02-09 Thread Stephen Hansen
>> Any tips on an approach to take to interrupt a COM call or set a timeout on >> it? >> > > There's no reliable way to do that. You could, of course, spin off a > separate thread to simulate SIGALRM using time.sleep, but once you had > done so, there's no good way to stop the thread that is bloc

Re: [python-win32] ReadDirectoryChangesW

2009-02-09 Thread Mark Hammond
On 10/02/2009 7:39 AM, Eric Blade wrote: Eric Blade wrote: I am getting significantly unreliable results using ReadDirectoryChangesW, attempting to use a simplified version of the codes that had been presented to me in my last query for help.. Eric, can you say what results you *are* getting an

Re: [python-win32] COM with timeouts?

2009-02-09 Thread Mark Hammond
On 10/02/2009 4:12 AM, Stephen Hansen wrote: Hi all. I have an application that's controlling Word via COM, and have situations where I'd like to set a timeout on those operations. Word might throw up an error message for example which stalls everything until clicked. In such a case I'd rather j

Re: [python-win32] COM with timeouts?

2009-02-09 Thread Stephen Hansen
On Mon, Feb 9, 2009 at 4:18 PM, Mark Hammond wrote: > If you kill the Word process, you could expect the COM RPC mechanism will > then return from the blocked call with some exception. ... Oh. Yes, that's brilliant. The thought never occurred to me to let the kill_word code itself serve as my sig