Message140973
| Author |
eli.bendersky |
| Recipients |
Aneesh, Peter.Caven, brian.curtin, eli.bendersky, georg.brandl, kbk, loewis, ned.deily, sunqiang, terry.reedy, tim.golden, vstinner |
| Date |
2011年07月23日.11:14:09 |
| SpamBayes Score |
6.5868794e-06 |
| Marked as misclassified |
No |
| Message-id |
<1311419650.01.0.897345171927.issue12540@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|