diff options
author | Antoine Pitrou <antoine@python.org> | 2021-05-13 17:48:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-13 17:48:15 (GMT) |
commit | 1aa3530314d339725519f4ad95b7dea4b00b657e (patch) | |
tree | a75d1475f46cd1c39d6abe34e8530ba247d16004 /Tools/scripts | |
parent | 3c0b070f3be5e5042fb7bccb72c81bcbdf664e2d (diff) | |
download | cpython-1aa3530314d339725519f4ad95b7dea4b00b657e.zip cpython-1aa3530314d339725519f4ad95b7dea4b00b657e.tar.gz cpython-1aa3530314d339725519f4ad95b7dea4b00b657e.tar.bz2 |
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
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/patchcheck.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index d9cceb5..8e59c78 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(): |