Skip to content
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

fix: Subprocess signal forwarding on Windows #2351

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

srfoster65
Copy link
Contributor

Pull Request Checklist

  • [ x] A news fragment is added in news/ describing what is new.
  • [ -] Test cases added for changed code.

Describe what you have changed in this PR.

Updated the signal used to interrupt a process (CTRL-C pressed) on windows.

Tested with the following python script as adding a test case is not practical.
Verification:

  1. Run the script. "pdm run test.py"
  2. Enter CTRL-C : Script is terminated
  3. Run the script. "pdm run test.py"
  4. Enter CTRL-C : Script is terminated

Without the pull request step 4 will not terminante the process.

from time import sleep

print(1)
while True:
    print(".", end="", flush=True)
    sleep(1)

@frostming frostming changed the title #2292 fix: Subprocess signal forwarding on Windows Oct 31, 2023
@frostming frostming linked an issue Oct 31, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/pdm/cli/commands/run.py 93.60% <0.00%> (ø)

📢 Thoughts on this report? Let us know!.

@frostming frostming merged commit 442545e into pdm-project:main Oct 31, 2023
22 of 23 checks passed
@j178 j178 mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pdm run does not catch ctrl-c on 2nd run (Win11)
2 participants