From 592d666e51767eb751e2f842798148245eb10d3f Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 7 Dec 2010 18:05:51 +0100 Subject: [PATCH] [FIX] tools.misc: correct argument to subprocess.Popen (via xrg, analysis/patch courtesy of Michael Telahun Makonnen) lp bug: https://launchpad.net/bugs/685115 fixed lp bug: https://launchpad.net/bugs/684661 fixed bzr revid: odo@openerp.com-20101207170551-o19ab06g1h2x3ygz --- bin/tools/misc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 0d5f7c67e5b..59230d5f141 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -141,15 +141,15 @@ def exec_pg_command(name, *args): prog = find_pg_tool(name) if not prog: raise Exception('Couldn\'t find %s' % name) - args2 = (os.path.basename(prog),) + args + args2 = (prog,) + args - return subprocess.call(args2, executable=prog) + return subprocess.call(args2) def exec_pg_command_pipe(name, *args): prog = find_pg_tool(name) if not prog: raise Exception('Couldn\'t find %s' % name) - pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, + pop = subprocess.Popen((prog,) + args, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) return (pop.stdin, pop.stdout) @@ -157,7 +157,7 @@ def exec_command_pipe(name, *args): prog = find_in_path(name) if not prog: raise Exception('Couldn\'t find %s' % name) - pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, + pop = subprocess.Popen((prog,) + args, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) return (pop.stdin, pop.stdout)