fix(keyringctl): set HOME, PATH, LANG required for hokey

This effectively requires en_US.UTF-8 to be an available lang, which is
a relative fair requirement and mandatory to set for hokey.
This commit is contained in:
Levente Polyak 2021-11-09 00:25:50 +01:00
parent f74a1be1ac
commit 2030de06a0
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8

View File

@ -4,6 +4,7 @@ from collections.abc import Iterable
from collections.abc import Iterator
from contextlib import contextmanager
from os import chdir
from os import environ
from os import getcwd
from pathlib import Path
from re import split
@ -110,7 +111,7 @@ def system(
The output of cmd
"""
if not env:
env = {}
env = {"HOME": environ["HOME"], "PATH": environ["PATH"], "LANG": "en_US.UTF-8"}
try:
return check_output(cmd, stderr=STDOUT, stdin=_stdin, env=env).decode()