From 92ab1a3e008f581737e25934115e70e5e8bc6b19 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Wed, 24 Jun 2020 07:47:31 +0200 Subject: [PATCH] [util/cli] make sure language is set to "C" to make parsing of CLI output reliable (i.e. always in english), set LC_ALL accordingly. see #662 --- bumblebee_status/util/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bumblebee_status/util/cli.py b/bumblebee_status/util/cli.py index 3e4face..8b39aab 100644 --- a/bumblebee_status/util/cli.py +++ b/bumblebee_status/util/cli.py @@ -30,6 +30,11 @@ def execute( """ args = cmd if shell else shlex.split(cmd) logging.debug(cmd) + + if not env: + env = os.environ.copy() + env["LC_ALL"] = "C" + try: proc = subprocess.Popen( args,