[New-bugs-announce] [issue33245] Unable to send CTRL_BREAK_EVENT

Ofek Lev report at bugs.python.org
Sun Apr 8 23:47:30 EDT 2018


New submission from Ofek Lev <ofekmeister at gmail.com>:

Vault (https://github.com/hashicorp/vault) requires the use of signals to trigger certain output https://www.vaultproject.io/docs/internals/telemetry.html.

The required signal isn't sent on py2.7:

>>> import os
>>> import signal
>>> import psutil
>>> p = psutil.Process([p.info for p in psutil.process_iter(attrs=['pid', 'name']) if 'vault' in p.info['name']][0]['pid'])
>>> p.exe()
'C:\\Users\\Ofek\\Desktop\\vault.exe'
>>> p.pid
15536
>>> os.kill(p.pid, signal.CTRL_BREAK_EVENT)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
WindowsError: [Error 87] The parameter is incorrect

Interestingly, on py3.6 that code works but instead produces this:

OSError: [WinError 87] The parameter is incorrect

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: <built-in function kill> returned a result with an error set

----------
components: Windows
messages: 315108
nosy: Ofekmeister, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Unable to send CTRL_BREAK_EVENT
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33245>
_______________________________________


More information about the New-bugs-announce mailing list