commands.getstatusoutput result is not command line exit value!!!

H

Hari Sekhon

I'm running a command like

import commands
result = commands.getstatusoutput('somecommand')
print result[0]
3072


However, this exit code made no sense so I ran it manually from the
command line in bash on my linux server and it gives the exit code as
12, not this weird 3072 number.

So I tried os.system('somecommand') in the interactive python shell and
it too returned the same result for the exit code as the unix shell, 12,
but re-running the commands.getstatusoutput() with the exact same
command still gave 3072.


Is commands.getstatusoutput() broken or something?


-h
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top