[Merge] lp:~evfool/software-properties/lp1060192 into lp:software-properties

Michael Vogt michaelvogt at imap.cc
Fri Feb 15 05:58:21 UTC 2013


On Wed, Feb 13, 2013 at 03:24:18PM -0000, Robert Roth wrote:
> Robert Roth has proposed merging lp:~evfool/software-properties/lp1060192 into lp:software-properties.
> 
> Commit message:
> - Do not use Shell=True unnecessarily in subprocess.Popen (bug #1060192)
[..]

Great! Thanks for working on this! 
 
>                      self.parent.report_action("Pinging %s..." % host)
> -                    commando = subprocess.Popen("ping -q -c 2 -W 1 -i 0.5 %s" % host,
> -                                                shell=True, stdout=subprocess.PIPE,
> +                    commando = subprocess.Popen(["ping", "-q", "-c 2", "-W 1", "-i 0.5", host],
> +                                                stdout=subprocess.PIPE,
>                                                  stderr=subprocess.STDOUT,
>                                                  universal_newlines=True).stdout
>                      while True:

You can also go one step further and do ["ping", "-c", "2", "-W",
"1"...]. 

But ping is fine with both. Thanks again for getting rid of the
shell=True. 

Cheers,
 Michael

-- 
https://code.launchpad.net/~evfool/software-properties/lp1060192/+merge/148210
Your team Ubuntu Core Development Team is requested to review the proposed merge of lp:~evfool/software-properties/lp1060192 into lp:software-properties.



More information about the Ubuntu-reviews mailing list