From c629c5bb593a1c1df6475f824df1732b959574e6 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 14 Jan 2020 11:16:33 +0100 Subject: [PATCH] Fix tarfile issues by using GNU_FORMAT with Python 3.8 (see issue #2856) --- tools/make_distrib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/make_distrib.py b/tools/make_distrib.py index b3211c558..1a0c45f6d 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -44,6 +44,10 @@ def create_tar_archive(input_dir, format): # Supported formats include "gz" and "bz2". tar_file = input_dir + '.tar.' + format tf = tarfile.open(tar_file, "w:" + format) + # The default tar format changed from GNU_FORMAT to PAX_FORMAT in Python 3.8. + # However, PAX_FORMAT generates additional @PaxHeader entries and truncates file + # names on Windows, so we'll stick with the previous default. + tf.format = tarfile.GNU_FORMAT tf.add(input_dir, arcname=os.path.basename(input_dir)) tf.close()