From 7f460890ede08cd5feb250cd7279c9070e34b1a0 Mon Sep 17 00:00:00 2001 From: Mike Blume Date: Wed, 18 Sep 2013 17:04:23 -0700 Subject: [PATCH] fall back to UTF-8 if locale returns None --- configure-syslog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure-syslog.py b/configure-syslog.py index 7a1e957..73f15c2 100755 --- a/configure-syslog.py +++ b/configure-syslog.py @@ -556,7 +556,7 @@ def find_syslog_process(): if results: #For python version 3 and above, reading binary data, not str, #so we need to decode the output first: - encoding = locale.getdefaultlocale()[1] + encoding = locale.getdefaultlocale()[1] or 'UTF-8' reslines = results.decode(encoding).split('\n') if len(reslines) == 1: ps_out_fields = reslines[0].split()