[FIX] Regression generated with the use of subprocess corrected(Thanks to Panos(xrg...
authorJay (OpenERP) <jvo@tinyerp.com>
Thu, 23 Dec 2010 19:43:49 +0000 (01:13 +0530)
committerJay (OpenERP) <jvo@tinyerp.com>
Thu, 23 Dec 2010 19:43:49 +0000 (01:13 +0530)
lp bug: https://launchpad.net/bugs/685115 fixed

bzr revid: jvo@tinyerp.com-20101223194349-vfilng87yf4h5cil

bin/tools/misc.py

index 10e8dff..de13e11 100644 (file)
@@ -134,15 +134,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
-    return subprocess.call(args2, executable=prog)
+    args2 = (prog,) + args
+    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)
 
@@ -150,8 +150,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)
 #----------------------------------------------------------