1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-30 10:22:31 +01:00

All braches/trunk:

- Force locale settings to C before running commands with piped output.
This commit is contained in:
imdano
2008-08-29 14:49:37 +00:00
parent 5a20b38e79
commit 9639cc8a14

View File

@@ -22,6 +22,7 @@ import locale
import gettext
import sys
from subprocess import Popen, STDOUT, PIPE
from copy import copy
import subprocess
import commands
@@ -76,7 +77,11 @@ def Run(cmd, include_stderr=False, return_pipe=False):
err = None
fds = False
f = Popen(cmd, shell=True, stdout=PIPE, stderr=err, close_fds=fds)
tmpenv = copy(os.environ)
tmpenv["LC_ALL"] = "C"
tmpenv["LANG"] = "C"
f = Popen(cmd, shell=True, stdout=PIPE, stderr=err, close_fds=fds,
env=tmpenv)
if return_pipe:
return f.stdout