[lug] Python: Unable to catch subprocess error
Jed S. Baer
blug at jbaer.cotse.net
Fri Mar 9 21:53:25 MST 2018
On Fri, 9 Mar 2018 18:58:18 -0700
Jed S. Baer wrote:
> Hi Folks. Any Python experts around?
>
> This seems so trivial; I must be missing something really obvious, or
> something explained in a non-obvious section of the docs.
Well, FWIW, this is something both trivial and non-obvious
> msg_out = subprocess.check_output(rcmd)
Needs to be (rcmd, shell=True) in order for the exeption to behave as
expected.
More information about the LUG
mailing list