[pacman-dev] pactest: set package tar format to GNU_FORMAT

Message ID 20191112061930.210086-1-allan@archlinux.org
State Accepted, archived
Headers show
Series [pacman-dev] pactest: set package tar format to GNU_FORMAT | expand

Commit Message

Allan McRae Nov. 12, 2019, 6:19 a.m. UTC
python-3.8 changed the default tar format to PAX_FORMAT. This caused
issues in our testsuite with package extraction of files with UTF-8
characters as we run the tests under the C locale.

error: error while reading package /tmp/pactest-xuhri4xa/var/cache/pacman/pkg/unicodechars-2.0-1.pkg.tar.gz: Pathname can't be converted from UTF-8 to current locale.

Set format back to GNU_FORMAT.

Signed-off-by: Allan McRae <allan@archlinux.org>

This patch at least gets us back to where we were with python-3.7.
We probably have heaps more issues with UTF-8 usage...

 test/pacman/pmpkg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 6a845222..e40868cc 100644
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -142,7 +142,7 @@  def makepkg(self, path):
         # Generate package metadata
-        tar = tarfile.open(self.path, "w:gz")
+        tar = tarfile.open(self.path, "w:gz", format=tarfile.GNU_FORMAT)
         for name, data in archive_files:
             info = tarfile.TarInfo(name)
             info.size = len(data)