-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Behaviour of os.kill() on Windows may be misunderstood #125298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this is a doc imprecision. What os.kill() does is: Lines 9528 to 9559 in 08f6bf7
So, it only expect PIDs but may try to use process handles instead in order to kill the desired PID. I am no Windows expert but that's how I understand it. Now, I think we could perhaps improve the wording though I don't have a good suggestion. cc @zooba as a Windows expert |
It kind of seems like
Could be removed for clarity. If something must be stated about the implementation, maybe: On Windows, the pid is mapped to a process handle which is then passed along with the signal to |
Actually this is a documentation issue, since |
Windows has not accepted process handles in many releases.
…honGH-125749) Windows has not accepted process handles in many releases. (cherry picked from commit 75ffac2) Co-authored-by: RUANG (James Roy) <[email protected]>
…honGH-125749) Windows has not accepted process handles in many releases. (cherry picked from commit 75ffac2) Co-authored-by: RUANG (James Roy) <[email protected]>
Windows has not accepted process handles in many releases. (cherry picked from commit 75ffac2) Co-authored-by: RUANG (James Roy) <[email protected]>
Windows has not accepted process handles in many releases. (cherry picked from commit 75ffac2) Co-authored-by: RUANG (James Roy) <[email protected]>
…honGH-125749) Windows has not accepted process handles in many releases.
…honGH-125749) Windows has not accepted process handles in many releases.
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 withPython 3.12.6
onWindows 10 Education Edition version 22H2 amd64
will result in an error.Test code:
Error message:
Linked PRs
os.kill
description #125749The text was updated successfully, but these errors were encountered: