Message140973
According to http://msdn.microsoft.com/en-us/library/7zt1y878%28v=vs.80%29.aspx, on Windows _spawnv in async mode (P_NOWAIT) returns the process _handle_, not the process ID.
win32_kill uses OpenProcess, passing it pid to obtain the handle, but this pid is already the process handle.
Removing the whole call to OpenProcess in win32_kill and passing pid (instead of handle) directly to TerminateProcess, solves the problem.
----
So this appears to be a mismatch between os.spawnv and os.kill on windows. The fist returns the process handle, the second expects a process ID.
Note that the documentation of os.spawnv mentions something about this:
If mode is P_NOWAIT, this function returns the process id of the new process; [...] On Windows, the process id will actually be the process handle, so can be used with the waitpid() function. |
|
| Date |
User |
Action |
Args |
| 2011-07-23 11:14:10 | eli.bendersky | set | recipients:
+ eli.bendersky, loewis, georg.brandl, terry.reedy, kbk, vstinner, tim.golden, ned.deily, brian.curtin, sunqiang, Peter.Caven, Aneesh |
| 2011-07-23 11:14:10 | eli.bendersky | set | messageid: <1311419650.01.0.897345171927.issue12540@psf.upfronthosting.co.za> |
| 2011-07-23 11:14:09 | eli.bendersky | link | issue12540 messages |
| 2011-07-23 11:14:09 | eli.bendersky | create | |
|