[python-win32] Strange issue with killing a process
Niki Spahiev
niki at vintech.bg
Tue Oct 21 03:27:59 EDT 2003
stephen wrote:
> But, and here's what's strange, this will only work if called from the same
> script. When I pickle 'id' and exit the script without killing the process, I
> can't start another script that would unpickle 'id' and then kill the process.
> Trying to do so gives me this error:
>
> Traceback (most recent call last):
> File "killprocess.py", line 20, in ?
> win32api.TerminateProcess(id,0)
> pywintypes.error: (6, 'TerminateProcess', 'The handle is invalid.')
>
> Anyone know what's going on?
Handles are closed when process terimantes. You must open new handle in
second process.
HTH
Niki Spahiev
More information about the Python-win32
mailing list