gitweb: tests: functional: Fix test failures in localized environment

Closes #2005

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Fioddor Superconcentrado <fioddor@gmail.com>
This commit is contained in:
Veiko Aasa 2021-01-05 11:39:21 +02:00 committed by Fioddor Superconcentrado
parent 2317239d8d
commit 7cf166e558
No known key found for this signature in database
GPG Key ID: 6E98A18FEBF77724

View File

@ -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