summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-05-13 11:14:23 -0700
committerGitHub <noreply@github.com>2021-05-13 11:14:23 -0700
commit04ce4c773667b0d9d05a89aea4720f8cf84e834e (patch)
tree4004f3733f8633e1784b1967f5c51122d07bf2c7 /Tools
parent[3.9] Revert "[3.9] bpo-38908: Fix issue when non runtime_protocol does not r... (diff)
downloadcpython-04ce4c773667b0d9d05a89aea4720f8cf84e834e.tar.gz
cpython-04ce4c773667b0d9d05a89aea4720f8cf84e834e.tar.bz2
cpython-04ce4c773667b0d9d05a89aea4720f8cf84e834e.zip
bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102)
The patch from [bpo-44074]() does not account for a possibly non-English locale and blindly greps for "HEAD branch" in a possibly localized text. Automerge-Triggered-By: GH:pitrou (cherry picked from commit 1aa3530314d339725519f4ad95b7dea4b00b657e) Co-authored-by: Antoine Pitrou <antoine@python.org>
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/patchcheck.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
index d9cceb5d5ac..8e59c78a4c5 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -78,11 +78,14 @@ def get_git_remote_default_branch(remote_name):
It is typically called 'main', but may differ
"""
cmd = "git remote show {}".format(remote_name).split()
+ env = os.environ.copy()
+ env['LANG'] = 'C'
try:
remote_info = subprocess.check_output(cmd,
stderr=subprocess.DEVNULL,
cwd=SRCDIR,
- encoding='UTF-8')
+ encoding='UTF-8',
+ env=env)
except subprocess.CalledProcessError:
return None
for line in remote_info.splitlines():