GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module by graingert · Pull Request #21956 · python/cpython

Conversation

@graingert

@graingert graingert commented Aug 25, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue41602

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Aug 25, 2020
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Aug 25, 2020
@graingert
bpo-41602: add tests for sigint handling in runpy
ec2856c
@graingert
graingert force-pushed the pymain-run-module-sigint branch from e3c009e to ec2856c Compare August 25, 2020 19:40
@blurb-it @graingert
📜🤖 Added by blurb_it.
78ba11c
graingert
graingert commented Aug 25, 2020
View reviewed changes
Comment thread Lib/test/test_runpy.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@graingert
check for STATUS_CONTROL_C_EXIT on windows
ce4601a
@graingert
graingert force-pushed the pymain-run-module-sigint branch from d2d0588 to ce4601a Compare August 25, 2020 21:19
graingert added 2 commits August 25, 2020 22:42
@graingert
REVERTME: flip the assertion to make the tests pass
a42916b
@graingert
bpo-41635: noop to work around flaky test
c483f65
graingert
graingert commented Aug 25, 2020
View reviewed changes
Comment thread Lib/test/test_runpy.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

graingert and others added 3 commits September 16, 2020 21:49
@graingert
Merge branch 'master' of git://github.com/python/cpython into pymain-…
e37a82a
…run-module-sigint
@graingert @gvanrossum
raise SIGINT exit code on KeyboardInterrupt from pymain_run_module
de65294
Co-Authored-By: Guido van Rossum <[email protected]>
@graingert
Revert "REVERTME: flip the assertion to make the tests pass"
0b325b6
This reverts commit a42916b.
@graingert graingert changed the title bpo-41602: add tests for sigint handling in runpy bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module Sep 16, 2020
@gvanrossum
gvanrossum requested a review from vstinner September 16, 2020 21:27
@gvanrossum

gvanrossum commented Sep 16, 2020

Copy link
Copy Markdown
Member

Requesting review from @vstinner -- since the actual fix was mine and I arrived at that through trial and error. Also, @vstinner do you think this can safely be backported to 3.8 and 3.9? IOW is it merely a bug or is the change in exit code (from 1 to SIGINT) significant enough to consider it a feature? (@graingert There's no documentation, is that right?)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Sep 17, 2020
View reviewed changes
Comment thread Modules/main.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Tests/2020-08-25-19-25-36.bpo-41602.Z64s0I.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gvanrossum

gvanrossum commented Sep 20, 2020

Copy link
Copy Markdown
Member

@graingert I am waiting for your response (e.g. a new commit) in response to Victor's review. Am I mistaken?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@graingert
reset _Py_UnhandledKeyboardInterrupt before calling runpy._run_module…
4486dcd
…_as_main
@graingert
graingert force-pushed the pymain-run-module-sigint branch from d2045de to 4486dcd Compare September 22, 2020 09:09
graingert and others added 2 commits September 22, 2020 10:10
@graingert
Merge branch 'master' of git://github.com/python/cpython into pymain-…
714ad5a
…run-module-sigint
@gvanrossum @vstinner
Capitalization and punctuation in blurb.
19f40f7
Co-authored-by: Victor Stinner <[email protected]>
gvanrossum
gvanrossum approved these changes Sep 22, 2020
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Sep 22, 2020
graingert
graingert commented Sep 22, 2020
View reviewed changes
Comment thread Misc/NEWS.d/next/Tests/2020-08-25-19-25-36.bpo-41602.Z64s0I.rst
@@ -0,0 +1 @@
Add tests for SIGINT handling in the runpy module.

@graingert graingert Sep 22, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add tests for SIGINT handling in the runpy module.
Raise SIGINT exit code on KeyboardInterrupt from pymain_run_module

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@graingert
graingert requested a review from gvanrossum September 22, 2020 15:15
gvanrossum
gvanrossum approved these changes Sep 22, 2020
View reviewed changes
@gvanrossum
gvanrossum merged commit a68a2ad into python:master Sep 22, 2020
@bedevere-bot

bedevere-bot commented Sep 22, 2020

Copy link
Copy Markdown

@gvanrossum: Please replace # with GH- in the commit message next time. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Sep 22, 2020
@graingert
graingert deleted the pymain-run-module-sigint branch September 22, 2020 16:12
@graingert

graingert commented Sep 24, 2020

Copy link
Copy Markdown
Contributor Author

@ambv I think this needs backporting to v3.8 and v3.9

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv ambv added needs backport to 3.8 labels Sep 24, 2020
@miss-islington

miss-islington commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

Thanks @graingert for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

Thanks @graingert for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

Sorry, @graingert and @gvanrossum, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker a68a2ad19c891faa891904b3da537911cc77df21 3.9

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned gvanrossum Sep 24, 2020
@miss-islington

miss-islington commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

Sorry @graingert and @gvanrossum, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker a68a2ad19c891faa891904b3da537911cc77df21 3.8

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv pushed a commit to ambv/cpython that referenced this pull request Sep 24, 2020
@graingert @ambv
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pym…
66ec0d3
…ain_run_module (pythonGH-21956)

Closes bpo issue 41602.
(cherry picked from commit a68a2ad)

Co-authored-by: Thomas Grainger <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 label Sep 24, 2020
@bedevere-bot

bedevere-bot commented Sep 24, 2020

Copy link
Copy Markdown

GH-22397 is a backport of this pull request to the 3.9 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shihai1991 added a commit to shihai1991/cpython that referenced this pull request Sep 24, 2020
@shihai1991
Merge remote-tracking branch 'origin/master' into bpo_39337_new_3
e29ec44
* origin/master: (27 commits)
  bpo-41428: Fix compiler warnings in unionobject.c (pythonGH-22388)
  bpo-41654: Fix compiler warning in MemoryError_dealloc() (pythonGH-22387)
  bpo-41833: threading.Thread now uses the target name (pythonGH-22357)
  bpo-30155: Add macros to get tzinfo from datetime instances (pythonGH-21633)
  bpo-33822: Update IDLE section of What's New 3.8 (pythonGH-22383)
  bpo-41844: Add IDLE section to What's New 3.9 (GN-22382)
  bpo-41841: Prepare IDLE News for 3.10 (pythonGH-22379)
  bpo-37779 : Add information about the overriding behavior of ConfigParser.read (pythonGH-15177)
  bpo-40170: Use inline _PyType_HasFeature() function (pythonGH-22375)
  bpo-40941: Fix stackdepth compiler warnings (pythonGH-22377)
  bpo-40941: Fix fold_tuple_on_constants() compiler warnings (pythonGH-22378)
  bpo-40521: Fix PyUnicode_InternInPlace() (pythonGH-22376)
  bpo-41834: Remove _Py_CheckRecursionLimit variable (pythonGH-22359)
  bpo-1635741, unicodedata: add ucd_type parameter to UCD_Check() macro (pythonGH-22328)
  bpo-1635741: Port _lsprof extension to multi-phase init (PEP 489) (pythonGH-22220)
  bpo-41513: Improve order of adding fractional values. Improve variable names. (pythonGH-22368)
  bpo-41816: `StrEnum.__str__` is `str.__str__` (pythonGH-22362)
  bpo-35764: Rewrite the IDLE Calltips doc section  (pythonGH-22363)
  bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType` (pythonGH-22336)
  bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (python#21956)
  ...
@gvanrossum

gvanrossum commented Sep 24, 2020

Copy link
Copy Markdown
Member

@ambv do you agree that this should be backported?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv

ambv commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

Yes, I made the backport to 3.9. 3.8 I'm less convinced due to the import-based conflicts in the tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv added a commit that referenced this pull request Sep 24, 2020
@ambv @graingert
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pym…
ca8d46d
…ain_run_module (GH-21956) (#22397)

Closes bpo issue 41602.
(cherry picked from commit a68a2ad)

Co-authored-by: Thomas Grainger <[email protected]>
@graingert graingert mentioned this pull request Sep 24, 2020
[3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) #22398
Merged
@bedevere-bot

bedevere-bot commented Sep 24, 2020

Copy link
Copy Markdown

GH-22398 is a backport of this pull request to the 3.8 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.8 label Sep 24, 2020
graingert added a commit to graingert/cpython that referenced this pull request Sep 24, 2020
@graingert
[3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pym…
cccc27a
…ain_run_module (pythonGH-21956)

Closes bpo issue 41602.
(cherry picked from commit a68a2ad)

Co-authored-by: Thomas Grainger <[email protected]>
ambv pushed a commit that referenced this pull request Sep 24, 2020
@graingert
[3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pym…
ae46229
…ain_run_module (GH-21956) (#22398)

Closes bpo issue 41602.
(cherry picked from commit a68a2ad)

Co-authored-by: Thomas Grainger <[email protected]>
ambv added a commit to ambv/cpython that referenced this pull request Oct 4, 2020
@ambv @graingert
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pym…
c26a666
…ain_run_module (pythonGH-21956) (python#22397)

Closes bpo issue 41602.
(cherry picked from commit a68a2ad)

Co-authored-by: Thomas Grainger <[email protected]>
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
@graingert @xzy3-cdc
bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_ru…
c1b3c0f
…n_module (python#21956)

Closes bpo issue 41602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@gvanrossum gvanrossum gvanrossum approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gvanrossum gvanrossum

Labels

tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@graingert @gvanrossum @bedevere-bot @miss-islington @ambv @vstinner @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.