Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101015

Re: subprocess check_output

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: subprocess check_output
Date 2015-12-31 09:32 +1100
Message-ID <mailman.88.1451514771.11925.python-list@python.org> (permalink)
References <CAJYwLU=p_U3V7MfOx3wCH8qkamK0aSHzF1i0g2ZBgTXDgrF03Q@mail.gmail.com> <20151230210227.GA88234@cskk.homeip.net>

Show all headers | View raw


On Thu, Dec 31, 2015 at 8:02 AM, Cameron Simpson <cs@zip.com.au> wrote:
> On 30Dec2015 21:14, Carlos Barera <carlos.barera@gmail.com> wrote:
>>
>> Trying to run a specific command (ibstat)  installed in /usr/sbin on an
>> Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh:
>> /usr/sbin/ibstat: No such file or directory"
>>
>> I tried the following:
>> - running the command providing full path
>> - running with executable=bash
>> - running with (['/bin/bash', '-c' , "/usr/sbin/ibstat"])
>>
>> Nothing worked ...
>
>
> The first check is to run the command from a shell. Does it work? Does
> "which ibstat" confirm that the command exist at that path? Is it even
> installed?

And do those checks as the same user as your script runs as, with the
same environment and all. You might find that a file is executable for
one user but not for another, or something.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: subprocess check_output Chris Angelico <rosuav@gmail.com> - 2015-12-31 09:32 +1100

csiph-web