Python version: 2.6.7 I have the following subprocess.call within a for loop which is exectuted 18 times, however, the process constantly hangs on 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 looks 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 whether I am doing something wrong here...I suspect a deadlock somewhere..
Would the stdout, stderr = process.communicate() deal with these issues?
Any expert answer on in which cases would the subprocess.call hang please? Thanks very much