感谢shelly指导,解决过程是用
def exec_pg_command_pipe(name, *args):
prog = find_pg_tool(name)
if not prog:
raise Exception('Couldn't find %s' % name)
if os.name == "nt":
cmd = '"' + prog + '" ' + ' '.join(args)
else:
cmd = prog + ' ' + ' '.join(args)
return os.popen2(cmd, 'b')
代替了tools下面misc文件的
中的
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,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
return (pop.stdin, pop.stdout)
shelly完美解决了问题,请shelly兄能分享下解决思路!俺还是一知半解,例如怎样知道问题是在tools下的misc。py呢?