Skip to content

Commit 1aa3530

Browse files
authored
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
1 parent 3c0b070 commit 1aa3530

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tools/scripts/patchcheck.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ def get_git_remote_default_branch(remote_name):
7878
It is typically called 'main', but may differ
7979
"""
8080
cmd = "git remote show {}".format(remote_name).split()
81+
env = os.environ.copy()
82+
env['LANG'] = 'C'
8183
try:
8284
remote_info = subprocess.check_output(cmd,
8385
stderr=subprocess.DEVNULL,
8486
cwd=SRCDIR,
85-
encoding='UTF-8')
87+
encoding='UTF-8',
88+
env=env)
8689
except subprocess.CalledProcessError:
8790
return None
8891
for line in remote_info.splitlines():

0 commit comments

Comments
 (0)