Chromium Code Reviews| Index: testing/libfuzzer/archive_corpus.py |
| diff --git a/testing/libfuzzer/archive_corpus.py b/testing/libfuzzer/archive_corpus.py |
| index 7e39bb54e449812ecf275775b07a9454f3e94923..71c132b5b215f5a666578cc757eeb2d52d8ee367 100755 |
| --- a/testing/libfuzzer/archive_corpus.py |
| +++ b/testing/libfuzzer/archive_corpus.py |
| @@ -13,6 +13,7 @@ from __future__ import print_function |
| import argparse |
| import os |
| import sys |
| +import warnings |
| import zipfile |
| @@ -31,8 +32,13 @@ def main(): |
| corpus_files.append(full_filename) |
| with zipfile.ZipFile(args.output, 'w') as z: |
| - for corpus_file in corpus_files: |
| - z.write(corpus_file, os.path.basename(corpus_file)) |
| + # Turn warnings into errors to interrupt the build: crbug.com/653920. |
| + with warnings.catch_warnings(): |
| + warnings.simplefilter("error") |
| + for i, corpus_file in enumerate(corpus_files): |
| + # To avoid duplication of filenames inside the archive, use numbers. |
| + arcname = '%016d' % i |
|
mmoroz
2016/11/29 13:53:41
I thought to use subdirectory_name + '_' + os.path
|
| + z.write(corpus_file, arcname) |
| if __name__ == '__main__': |