From e8f252d8c56fbe9c200288eebbd2725ce3ec43e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20L=C3=BCdtke?= Date: Thu, 25 May 2017 23:33:43 +0200 Subject: [PATCH] enforce LANG=C in read_stdout --- src/rosdep2/shell_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rosdep2/shell_utils.py b/src/rosdep2/shell_utils.py index 4b13bfb0f..377b517af 100644 --- a/src/rosdep2/shell_utils.py +++ b/src/rosdep2/shell_utils.py @@ -42,6 +42,8 @@ else: python3 = False +env = dict(os.environ) +env['LANG'] = 'C' def read_stdout(cmd, capture_stderr=False): ''' @@ -56,14 +58,14 @@ def read_stdout(cmd, capture_stderr=False): standard error output each as string. ''' if capture_stderr: - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) std_out, std_err = p.communicate() if python3: return std_out.decode(), std_err.decode() else: return std_out, std_err else: - p = subprocess.Popen(cmd, stdout=subprocess.PIPE) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env) std_out, std_err = p.communicate() # ignore stderr if python3: return std_out.decode()