Fix locale related parsing error in git.py

* Fix locale related parsing error in git.py

This fixes the issue found at https://github.com/ansible/ansible/issues/77213 which got introduced by changing over to "best parseable locale" approach, but missing out the requirement of locales other than `L` having to have `LANGUAGE` specified as well. For further details, check this post within the issue discussion: https://github.com/ansible/ansible/issues/77213#issuecomment-1446919617

* Add changelog

Create 81931-locale-related-parsing-error-git.yml
pull/82074/head
Michael Pardatscher 2 years ago committed by GitHub
parent fe94a99aa2
commit b4920c83ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

Loading…
Cancel
Save