Skip to content

Commit

Permalink
Merge pull request #29 from ehaupt/specify_tar_format
Browse files Browse the repository at this point in the history
Use GNU_FORMAT in tarfile to avoid '././@PaxHeader' in archives
  • Loading branch information
chezou committed Apr 17, 2024
2 parents 3208bfa + 590b41b commit 37d95f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tdworkflow/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def archive_files(target_dir: str, exclude_patterns: List[str]) -> io.BytesIO:

target_dir_path = Path(target_dir)
_bytes = io.BytesIO()
with tarfile.open(mode="w:gz", fileobj=_bytes) as tar:
with tarfile.open(mode="w:gz", fileobj=_bytes, format=tarfile.GNU_FORMAT) as tar:
for current_dir, directories, files in os.walk(target_dir_path):
for file_or_dir in [*directories, *files]:
file_path = Path(os.path.join(current_dir, file_or_dir))
Expand Down

0 comments on commit 37d95f7

Please sign in to comment.