Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python error Suppressing signal 18 to win32

I created a simple test.py with the following:

import sys
res = sys.stdin.read()
print(res)

but when I tried to run

python test.py

then i input

hello

and end the input by Ctrl+z, I got the following message:

4 [sig] bash 11516! sigpacket::process: Suppressing signal 18 to win32 process (pid 10620)

I could not figure out what was wrong.

screenshot

like image 744
Vinh Hoang Avatar asked May 01 '18 02:05

Vinh Hoang


1 Answers

Signal 18 is just the handler for Ctrl+Z. (Technically it maps to SIGTSTP.) The signal tells the process to suspend. Since the signal is generally meaningless to a Windows process, git-bash suppresses the message, but it still lets you know that it suppressed that signal.

Unfortunately, MinTTY, the default git-bash terminal, doesn't connect up the console correctly for native Windows console applications. So even ignoring the warning message, the python interpreter isn't really working correctly anyway. (More info)

In order to get python hooked up correctly you need to use winpty to launch python. The command:

winpty python test.py

will work. You could also use git-cmd if you need access to git commands, or open a standard Windows command prompt and run python there if you don't.

like image 133
theB Avatar answered Sep 28 '22 04:09

theB