You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) #85768
changed the title [-]Python doesn't exit with proper resultcode on SIGINT in runpy[/-][+]Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)[/+]on Aug 20, 2020
changed the title [-]Python doesn't exit with proper resultcode on SIGINT in runpy[/-][+]Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)[/+]on Aug 20, 2020
graingert commented on Aug 20, 2020
graingertmannequin
MannequinAuthor
More actions
I've now eliminated pymain_run_stdin and pymain_run_command, both process a KeyboardInterrupt as -2
see attached test_exit_command_stdin.py
graingert commented on Aug 21, 2020
graingertmannequin
MannequinAuthor
More actions
adding vstinner, as this seems related to pymain_run_module rather than runpy
New changeset a68a2ad by Thomas Grainger in branch 'master': bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (bpo-21956) a68a2ad
New changeset ca8d46d by Łukasz Langa in branch '3.9':
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (bpo-22397) ca8d46d
New changeset ae46229 by Thomas Grainger in branch '3.8':
[3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (bpo-22398) ae46229
New changeset c26a666 by Łukasz Langa in branch '3.9':
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (bpo-22397) c26a666
Activity
graingert commentedon Aug 20, 2020
when running "python -m ham.py" KeyboardInterrupt should result in -2, but results in 1
see test case
graingert commentedon Aug 20, 2020
see also https://bugs.python.org/issue1054041
graingert commentedon Aug 20, 2020
I think I've eliminated runpy.py, as I still get a
-2when using:or
see attached test_exit_runpy.py
It seems the only difference is if pymain_run_file or pymain_run_module is used.
[-]Python doesn't exit with proper resultcode on SIGINT in runpy[/-][+]Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)[/+][-]Python doesn't exit with proper resultcode on SIGINT in runpy[/-][+]Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)[/+]graingert commentedon Aug 20, 2020
I've now eliminated pymain_run_stdin and pymain_run_command, both process a KeyboardInterrupt as -2
see attached test_exit_command_stdin.py
graingert commentedon Aug 21, 2020
adding vstinner, as this seems related to pymain_run_module rather than runpy
11 remaining items
graingert commentedon Sep 16, 2020
I pushed that patch
gvanrossum commentedon Sep 16, 2020
Why did you remove 3.10?
graingert commentedon Sep 16, 2020
nice the tests pass with that fix
gvanrossum commentedon Sep 22, 2020
New changeset a68a2ad by Thomas Grainger in branch 'master':
bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (bpo-21956)
a68a2ad
ambv commentedon Sep 24, 2020
New changeset ca8d46d by Łukasz Langa in branch '3.9':
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (bpo-22397)
ca8d46d
ambv commentedon Sep 24, 2020
New changeset ae46229 by Thomas Grainger in branch '3.8':
[3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (bpo-22398)
ae46229
ambv commentedon Oct 5, 2020
New changeset c26a666 by Łukasz Langa in branch '3.9':
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (bpo-22397)
c26a666