Skip to content

Working with pyinstaller and singnals (SIGTSTP) #8341

Closed Answered by rokm
gammore asked this question in Help
Discussion options

You must be logged in to vote

Signals are somewhat messy in onefile builds, because it has a parent and a child process, and the semantics of passing the signals between the two are ill-posed in some cases, due to issue of sending signal to parent process (e.g., via kill -SIGNUM <pid>) and sending signal to whole process group (which is what pressing Ctrl+C or Ctrl+Z in your terminal actually does).

I think onedir build of your example program would behave as you expect, i.e., similar to unfrozen python. Your python code disables the signal handling in program process, so if you send SIGINT or SIGTSTP to it via kill, nothing happens. That's also why if you press Ctrl+C or Ctrl+Z, the program ignores the signal it rece…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gammore
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants