From a5ec00f89fce1b34581193828831d6d0b0f87ad8 Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Tue, 5 Apr 2016 19:23:33 +0200 Subject: [PATCH] Reset all locale environment variables before running svn commands We screenscrape the output of svn(1), so better ensure it is using the C locale. Fixes #3255 --- lib/ansible/modules/source_control/subversion.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/source_control/subversion.py b/lib/ansible/modules/source_control/subversion.py index c45b11bfe0..3fb88d5e49 100644 --- a/lib/ansible/modules/source_control/subversion.py +++ b/lib/ansible/modules/source_control/subversion.py @@ -216,7 +216,10 @@ def main(): export = module.params['export'] switch = module.params['switch'] - os.environ['LANG'] = 'C' + # We screenscrape a huge amount of svn commands so use C locale anytime we + # call run_command() + module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C') + svn = Subversion(module, dest, repo, revision, username, password, svn_path) if export or not os.path.exists(dest):