From 1154321bb387a348b36473f9d446ac211a9ab594 Mon Sep 17 00:00:00 2001 From: Patrik Dufresne Date: Wed, 31 Jan 2018 17:17:22 -0500 Subject: [PATCH] Define the tar.gz encoding. When LANG is not define, python will fallback to ascii encoding for the creation of tar.gz archive. This is not the expected behaviour. We want to always use UTF8 when creating archive. --- rdiffweb/archiver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdiffweb/archiver.py b/rdiffweb/archiver.py index 959fa937..256cddb0 100644 --- a/rdiffweb/archiver.py +++ b/rdiffweb/archiver.py @@ -57,10 +57,10 @@ class TarArchiver(object): # Open the tar archive with the right method. if isinstance(dest, str): - self.z = tarfile.open(name=dest, mode=mode) + self.z = tarfile.open(name=dest, mode=mode, encoding='UTF8') self.fileobj = None else: - self.z = tarfile.open(fileobj=dest, mode=mode) + self.z = tarfile.open(fileobj=dest, mode=mode, encoding='UTF8') self.fileobj = dest def addfile(self, filename, arcname): -- GitLab