-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
Description
The latest os.kill() document says “The Windows version of kill() additionally takes process handles to be killed,” but the kill()
function actually does not accept process handles instead of process IDs. Runing the following code with Python 3.12.6
on Windows 10 Education Edition version 22H2 amd64
will result in an error.
Test code:
import os, signal
proc_handle = os.spawnl(os.P_NOWAIT, r'C:\Windows\notepad.exe', 'notepad.exe')
os.kill(proc_handle, signal.SIGTERM)
Error message:
Traceback (most recent call last):
File "C:\Users\John\Documents\Python\os_kill_proc_handle.py", line 3, in <module>
os.kill(proc_handle, signal.SIGTERM)
OSError: [WinError 87] The parameter is incorrect
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Todo