79176245

Date: 2024-11-11 02:46:21
Score: 1
Natty:
Report link

This behavior is due to how signals are handled when Python is launched from a shell script with &. When Python is launched directly or through noproblem.sh, the default signal handler for SIGINT is used, which raises KeyboardInterrupt. However, when launched through problem.sh, the signal handler is set to SIG_IGN, causing SIGINT to be ignored. This behavior is not explicitly documented, but it's related to how the shell handles signals when running Python as a background process.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Mr.UNIcode