Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Downloader] Ensure consistent output from git commands #3160

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/downloader/3160.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure consistent output from git commands for purpose of parsing.
6 changes: 6 additions & 0 deletions redbot/cogs/downloader/repo_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ async def _run(
"""
env = os.environ.copy()
env["GIT_TERMINAL_PROMPT"] = "0"
# attempt to force all output to plain ascii english
# some methods that parse output may expect it
# according to gettext manual both variables have to be set:
# https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables
env["LC_ALL"] = "C"
env["LANGUAGE"] = "C"
kwargs["env"] = env
async with self._repo_lock:
p: CompletedProcess = await self._loop.run_in_executor(
Expand Down