diff --git a/changelogs/fragments/81931-locale-related-parsing-error-git.yml b/changelogs/fragments/81931-locale-related-parsing-error-git.yml new file mode 100644 index 00000000000..8ec3e9c5082 --- /dev/null +++ b/changelogs/fragments/81931-locale-related-parsing-error-git.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Fix setting proper locale for git executable when running on non english systems, ensuring git output can always be parsed. diff --git a/lib/ansible/modules/git.py b/lib/ansible/modules/git.py index f40e43f30a5..5460a24a269 100644 --- a/lib/ansible/modules/git.py +++ b/lib/ansible/modules/git.py @@ -1263,7 +1263,7 @@ def main(): # We screenscrape a huge amount of git commands so use C locale anytime we # call run_command() locale = get_best_parsable_locale(module) - module.run_command_environ_update = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale) + module.run_command_environ_update = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale, LANGUAGE=locale) if separate_git_dir: separate_git_dir = os.path.realpath(separate_git_dir)