From b16882f7d5f15201dd3d49b5aadd67cabca57b9f Mon Sep 17 00:00:00 2001 From: itdaniher Date: Mon, 13 Jul 2020 16:33:30 -0400 Subject: [PATCH] Add the format=tarfile.GNU_FORMAT to tarfile.open arguments to address Py3.8 change "The default format for new archives was changed to PAX_FORMAT from GNU_FORMAT." and resulting > unsupported PAX tar header type 'x' on `dpkg --install` --- pkg/archive.py | 2 +- pkg/make_deb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/archive.py b/pkg/archive.py index f15b4251..a2de6747 100644 --- a/pkg/archive.py +++ b/pkg/archive.py @@ -146,7 +146,7 @@ def __init__(self, # Instead, we manually re-implement gzopen from tarfile.py and set mtime. self.fileobj = gzip.GzipFile( filename=name, mode='w', compresslevel=9, mtime=self.default_mtime) - self.tar = tarfile.open(name=name, mode=mode, fileobj=self.fileobj) + self.tar = tarfile.open(name=name, mode=mode, fileobj=self.fileobj, format=tarfile.GNU_FORMAT) self.members = set([]) self.directories = set([]) diff --git a/pkg/make_deb.py b/pkg/make_deb.py index d34ac755..61340b59 100644 --- a/pkg/make_deb.py +++ b/pkg/make_deb.py @@ -146,7 +146,7 @@ def CreateDebControl(extrafiles=None, **kwargs): # Create the control.tar file tar = BytesIO() with gzip.GzipFile('control.tar.gz', mode='w', fileobj=tar, mtime=0) as gz: - with tarfile.open('control.tar.gz', mode='w', fileobj=gz) as f: + with tarfile.open('control.tar.gz', mode='w', fileobj=gz, format=tarfile.GNU_FORMAT) as f: tarinfo = tarfile.TarInfo('./control') control_file_data = controlfile.encode('utf-8') tarinfo.size = len(control_file_data)