[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
This commit is contained in:
Olivier Dony 2010-12-07 18:05:51 +01:00
parent 8233e8b505
commit 592d666e51
1 changed files with 4 additions and 4 deletions

View File

@ -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)