Force LANGUAGE=en to fix svn output parsing

TEST=Run with LANGUAGE=fr_CA, gclient still works.

Review URL: http://codereview.chromium.org/3192001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@56354 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 15 years ago
parent 399318ec99
commit c41c27c86e

@ -49,10 +49,13 @@ def CheckCall(command, cwd=None, print_error=True):
stderr = None
if not print_error:
stderr = subprocess.PIPE
env = os.environ.copy()
env['LANGUAGE'] = 'en'
process = subprocess.Popen(command, cwd=cwd,
shell=sys.platform.startswith('win'),
stdout=subprocess.PIPE,
stderr=stderr)
stderr=stderr,
env=env)
std_out, std_err = process.communicate()
except OSError, e:
raise CheckCallError(command, cwd, e.errno, None)
@ -272,13 +275,15 @@ def SubprocessCallAndFilter(command,
if print_messages:
print('\n________ running \'%s\' in \'%s\''
% (' '.join(command), in_directory))
env = os.environ.copy()
env['LANGUAGE'] = 'en'
# *Sigh*: Windows needs shell=True, or else it won't search %PATH% for the
# executable, but shell=True makes subprocess on Linux fail when it's called
# with a list because it only tries to execute the first item in the list.
kid = subprocess.Popen(command, bufsize=0, cwd=in_directory,
shell=(sys.platform == 'win32'), stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stderr=subprocess.STDOUT, env=env)
# Do a flush of sys.stdout before we begin reading from the subprocess's
# stdout.

@ -40,9 +40,12 @@ class CheckCallTestCase(GclientUtilBase):
command = ['boo', 'foo', 'bar']
process = self.mox.CreateMockAnything()
process.returncode = 0
env = gclient_utils.os.environ.copy()
env['LANGUAGE'] = 'en'
gclient_utils.subprocess.Popen(
command, cwd=None,
stderr=None,
env=env,
stdout=gclient_utils.subprocess.PIPE,
shell=gclient_utils.sys.platform.startswith('win')).AndReturn(process)
process.communicate().AndReturn(['bleh', 'foo'])
@ -53,9 +56,12 @@ class CheckCallTestCase(GclientUtilBase):
command = ['boo', 'foo', 'bar']
process = self.mox.CreateMockAnything()
process.returncode = 42
env = gclient_utils.os.environ.copy()
env['LANGUAGE'] = 'en'
gclient_utils.subprocess.Popen(
command, cwd=None,
stderr=None,
env=env,
stdout=gclient_utils.subprocess.PIPE,
shell=gclient_utils.sys.platform.startswith('win')).AndReturn(process)
process.communicate().AndReturn(['bleh', 'foo'])
@ -78,6 +84,8 @@ class SubprocessCallAndFilterTestCase(GclientUtilBase):
fail_status = None
pattern = 'a(.*)b'
test_string = 'ahah\naccb\nallo\naddb\n'
env = gclient_utils.os.environ.copy()
env['LANGUAGE'] = 'en'
class Mock(object):
stdout = StringIO.StringIO(test_string)
def wait(self):
@ -89,6 +97,7 @@ class SubprocessCallAndFilterTestCase(GclientUtilBase):
gclient_utils.subprocess.Popen(
command, bufsize=0, cwd=in_directory,
shell=(gclient_utils.sys.platform == 'win32'),
env=env,
stdout=gclient_utils.subprocess.PIPE,
stderr=gclient_utils.subprocess.STDOUT).AndReturn(kid)
self.mox.ReplayAll()

Loading…
Cancel
Save