backups: Set LANG=C.UTF-8 when extracting archive

This allows for filenames with unicode characters.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
James Valleroy 2018-07-09 21:14:49 -04:00 committed by Joseph Nuthalapati
parent 4f6ed92286
commit 40607c84c8
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35

View File

@ -93,10 +93,11 @@ def subcommand_delete(arguments):
def subcommand_extract(arguments):
"""Extract archive contents."""
prev_dir = os.getcwd()
env = dict(os.environ, LANG='C.UTF-8')
try:
os.chdir(os.path.expanduser(arguments.destination))
subprocess.run(['borg', 'extract', REPOSITORY + '::' + arguments.name],
check=True)
env=env, check=True)
finally:
os.chdir(prev_dir)