Message315108
| Author |
Ofekmeister |
| Recipients |
Ofekmeister, paul.moore, steve.dower, tim.golden, zach.ware |
| Date |
2018年04月09日.03:47:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1523245650.34.0.682650639539.issue33245@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|