diff --git a/infra/helper.py b/infra/helper.py index 8ed61c405..56e4b233d 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -534,9 +534,19 @@ def _get_latest_corpus(project_name, fuzz_target, base_corpus_dir): 'ls', corpus_backup_url ] - output = subprocess.check_output(command).splitlines() + + corpus_listing = subprocess.Popen( + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output, error = corpus_listing.communicate() + + # Some fuzz targets (e.g. new ones) may not have corpus yet, just skip those. + if corpus_listing.returncode: + print('WARNING: corpus for {0} not found:\n{1}'.format(fuzz_target, error), + file=sys.stderr) + return + if output: - latest_backup_url = output[-1] + latest_backup_url = output.splitlines()[-1] archive_path = corpus_dir + '.zip' command = [ 'gsutil',