diff --git a/patoolib/util.py b/patoolib/util.py index ba6cc62..878fe12 100644 --- a/patoolib/util.py +++ b/patoolib/util.py @@ -86,16 +86,12 @@ def backtick (cmd): return subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] -def quote_arg (arg): - if " " in arg: - return '"%s"' % arg - return arg - - def run (cmd, **kwargs): """Run command without error checking. @return: command return code""" - log_info("running %s" % " ".join(map(quote_arg, cmd))) + args = (" ".join(map(shell_quote, cmd)), + ", ".join("%s=%s" % (k, shell_quote(v)) for k, v in kwargs.items())) + log_info("running %s with %s" % args) return subprocess.call(cmd, **kwargs)