aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2022-06-22 12:22:21 -0400
committerJake Hunsaker <jhunsake@redhat.com>2022-06-24 09:44:02 -0400
commit92f921b901a31f43204a9b08538bc9afdfa56b93 (patch)
tree8a2da040cc41a450fdb069890b15bd2abd6aec28
parent21fa70a730c1e3568bcdc9d33b0731b85f3ef907 (diff)
downloadsos-92f921b901a31f43204a9b08538bc9afdfa56b93.tar.gz
[utilities] Switch locale to C.UTF-8
Changes the `LC_ALL` locale env var used for all command collections from `C` to `C.UTF-8` which should provide safer/more reliable output from non-English localizations. This is backed up by PEP-538: https://peps.python.org/pep-0538/ Closes: #2946 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/utilities.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/utilities.py b/sos/utilities.py
index 1075d1d4..7aee016e 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -159,7 +159,7 @@ def sos_get_command_output(command, timeout=TIMEOUT_DEFAULT, stderr=False,
cmd_env = os.environ.copy()
# ensure consistent locale for collected command output
- cmd_env['LC_ALL'] = 'C'
+ cmd_env['LC_ALL'] = 'C.UTF-8'
# optionally add an environment change for the command
if env:
for key, value in env.items():