Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) #85768
Copy link
Copy link
Closed
Closed
Copy link
Labels
3.10 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
when running "python -m ham.py" KeyboardInterrupt should result in -2, but results in 1
see test case
- added3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Aug 20, 2020 see also https://bugs.python.org/issue1054041
I think I've eliminated runpy.py, as I still get a
-2when using:import runpy runpy.run_module("ham")
or
runpy._run_module_as_main("ham")
see attached test_exit_runpy.py
It seems the only difference is if pymain_run_file or pymain_run_module is used.
- 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 I've now eliminated pymain_run_stdin and pymain_run_command, both process a KeyboardInterrupt as -2
see attached test_exit_command_stdin.py
adding vstinner, as this seems related to pymain_run_module rather than runpy
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Aug 23, 2020 11 remaining items
I pushed that patch
Why did you remove 3.10?
nice the tests pass with that fix
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: