[python-win32] Understanding "Access Denied" when calling win32process.TerminateProcess() from Run As Administrator prompt
Tim Golden
mail at timgolden.me.uk
Wed Oct 2 14:48:58 CEST 2013
On 01/10/2013 20:03, Tony Cappellini wrote:
>
> When running from a *"Run As Administrator"* prompt on Windows 7
> Professional 32-Bit,
>
> my Top-level python script spawns a process (which is another python
> script) using os.spawnv( )
>
> When the top-level script ends, it attemps to call
> win32process.TerminateProcess() with the handle
> that was created during the os.spawnv() call.
>
> win32process.TerminateProcess(self._handle, exitCode)
> pywintypes.error: (5, 'TerminateProcess', 'Access is denied.')
Well, slightly oddly, this is the error message you receive when you try
to terminate a process which has already terminated! I don't know if
this behaviour is new to Win7 (and I'm reluctant to build a WinXP VM
just to test one line of code :) ).
Could that be the answer?
TJG
More information about the python-win32
mailing list