Python version: 2.6.7 I have the following subprocess.call in a for loop that gets called 18 times, however the process hangs constantly in the 19th loop:
if config.get_bool_option(NAME, 'exclude_generated_code', True): for conf in desc.iter_configs(): for gen in desc.iter_generators(conf): generator.initialize_generated_path(gen, desc) for genpath in gen.generated_path: os.rename(cov_file, cov_file+'.temp') exclude = ['lcov'] exclude += ['-r', cov_file+'.temp', '"'+genpath+'/*"'] exclude += ['-o', cov_file] if verbose: Tracer.log.info("Running "+ ' '.join(exclude)) try: subprocess.call(' '.join(exclude), stdout=out, stderr=out, shell=True) except subprocess.CalledProcessError, e: if verbose: Tracer.log.info("TESTING: Got Exception \n")
The console output is as follows:
Running lcov -r /remote/XXXXXX/coverage.19.temp "/remote/XXXXXX/xml/2009a/generated/*" -o /remote/XXXXX/gcov/coverage.19
Since I am not very familiar with python scripts, I just wandered around if I was doing something wrong here ... I suspect that somewhere is a dead end.
Can stdout, stderr = process.communicate() solve these problems?
Some kind of expert answer, in which cases the subprocess. Many thanks
source share