Running command with python subprocess.call fails but works correctly when typed into cmd.exe -


so background on i'm trying setup cocos-2dx v3.0 project. i've gotten python script creates project run , i'm trying build , run project can start development on game. issue i'm running into, per question, 1 of commands issued subprocess.call fails every time build , run python script run. when run exact command being passed in shell myself however, runs perfectly.

the method in python calling subprocess.call:

@staticmethod def run_cmd(command, verbose):     if verbose:         logging.debug("running: '%s'\n" % ''.join(command))     else:         log_path = ccplugin._log_path()         command += ' >"%s" 2>&1' % log_path         print "calling run_cmd"     ret = subprocess.call(command, shell=true)     if ret != 0:         message = "error running command, return code: %s" % str(ret)         if not verbose:             message += ". check log file @ %s" % log_path         raise ccpluginerror(message) 

this used multiple times in script , succeeds every other time.

the command failing when called python runs fine when directly input cmd:

"c:\users\patrick\downloads\apache-ant-1.9.4-bin\apache-ant-1.9.4\bin\ant" clean debug -f c:\hyperfusion\runewars\runewars\proj.android\build.xml -dsdk.dir="c:\users\patrick\copap\software\adt-bundle-windows-x86-20130522\sdk" 

any , appreciated. i've done bunch of googling haven't come across seem help. i'm new python (and didn't expect have debug since these setup scripts provided cocos) apologies if i'm missing simple here.

os windows 7 if has bearing on issue.

thanks!

there reason why i've asked 'verbose' flag. if it's set 'false', try comment out 1 line shown below:

 else:     log_path = ccplugin._log_path()     # command += ' >"%s" 2>&1' % log_path     

what happen there next command won't able open log file writing because has been opened previous command.it explanation why every other command succeeds wrote.

just hypothesis should easy check. luck!


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -