This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Incorrect ValueError message for subprocess.Popen.send_signal() on Windows
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brian.curtin Nosy List: astrand, brian.curtin, giampaolo.rodola
Priority: normal Keywords:

Created on 2010-06-09 18:25 by giampaolo.rodola, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg107408 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-06-09 18:25
def send_signal(self, sig):
            """Send a signal to the process
            """
            if sig == signal.SIGTERM:
                self.terminate()
            elif sig == signal.CTRL_C_EVENT:
                os.kill(self.pid, signal.CTRL_C_EVENT)
            elif sig == signal.CTRL_BREAK_EVENT:
                os.kill(self.pid, signal.CTRL_BREAK_EVENT)
            else:
                raise ValueError("Only SIGTERM is supported on Windows")


Just noticed right now while I was reading subprocess source code.
I guess that should be "Only SIGTERM, CTRL_C_EVENT or CTRL_BREAK_EVENT are supported on Windows".
msg107409 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-06-09 18:37
Good catch, I forgot to update that message when adding the other signal support.

Would you rather see something more generic like "Unsupported signal" rather than start listing all of the signals?

Another alternative is to allow any signal through including integers, which are then just passed to os.kill (ints passed to kill get set as the proc exit code). However, we can't do that with 2.7, but could with 3.2.
msg115715 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-09-06 16:31
Fixed in r84559 (py3k) and r84560 (release27-maint).
History
Date User Action Args
2022-04-11 14:57:02adminsetgithub: 53202
2010-09-06 16:31:55brian.curtinsetstatus: open -> closed
resolution: fixed
messages: + msg115715

stage: needs patch -> resolved
2010-06-09 18:37:23brian.curtinsetassignee: brian.curtin
type: behavior
components: + Windows

nosy: + brian.curtin
messages: + msg107409
stage: needs patch
2010-06-09 18:25:34giampaolo.rodolacreate