From 7cf166e5588318e42d6732c85ab5ed897fa14caf Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Tue, 5 Jan 2021 11:39:21 +0200 Subject: [PATCH] gitweb: tests: functional: Fix test failures in localized environment Closes #2005 Signed-off-by: Veiko Aasa Reviewed-by: Fioddor Superconcentrado --- plinth/modules/gitweb/tests/test_functional.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plinth/modules/gitweb/tests/test_functional.py b/plinth/modules/gitweb/tests/test_functional.py index 9d25ed002..80bb1e76d 100644 --- a/plinth/modules/gitweb/tests/test_functional.py +++ b/plinth/modules/gitweb/tests/test_functional.py @@ -288,7 +288,11 @@ def _gitweb_temp_directory(): def _gitweb_git_command_is_successful(command, cwd): """Check if a command runs successfully or gives authentication error""" - process = subprocess.run(command, capture_output=True, cwd=cwd) + # Tell OS not to translate command return messages + env = os.environ.copy() + env['LC_ALL'] = 'C' + + process = subprocess.run(command, capture_output=True, cwd=cwd, env=env) if process.returncode != 0: if 'Authentication failed' in process.stderr.decode(): return False