[Twisted-Python] sudo asking for a password during utils.getProcessOutputAndValue()

Michael Thompson michaelnt at gmail.com
Tue Jul 7 17:41:32 EDT 2009

2009/7/7 Steve Freitas <sflist at ihonk.com>:
> Hi all,
> If from inside my twisted program I do...
> commands.getstatusoutput('sudo blah blah')
> ...it works great. If instead I do...

Does working mean it sucessfully asks for the password or that it
doesn't ask for the password?

> utils.getProcessOutputAndValue('/usr/bin/sudo', path='/usr/bin', args=('blah
> blah',))
> ...it gets stuck asking for the sudo password. I've tried a bunch of
> variations in the latter call, like lumping the args into the executable
> string, getting rid of "/usr/bin" in the executable, changing the path to
> the executing user's home directory and so on. Any ideas?

sudo can cache your password for a period of time, so you won't have
to enter it every time you run a sudo command.


More information about the Twisted-Python mailing list