diff --git a/util/changes.py b/util/changes.py index 814359470..eaeec9d83 100644 --- a/util/changes.py +++ b/util/changes.py @@ -12,7 +12,11 @@ ALLOWED_TYPES = {tarfile.REGTYPE, tarfile.AREGTYPE} def files_and_dirs_from_tar(source_stream, removed_prefix_collector): - tar_stream = tarfile.open(mode='r|*', fileobj=source_stream) + try: + tar_stream = tarfile.open(mode='r|*', fileobj=source_stream) + except tarfile.ReadError: + # Empty tar file + return for tar_info in tar_stream: absolute = os.path.relpath(tar_info.name.decode('utf-8'), './')