Specify encoding for AUTHORS file

Needed to resolve "UnicodeDecodeError" for Python 3 presubmit checks.

Bug: 1210746
Change-Id: If55190ffc9f99c671a84fe9b3539317e464639cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2904927
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Alan Screen <awscreen@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
changes/27/2904927/3
Alan Screen 4 years ago committed by LUCI CQ
parent 6b0a611c2c
commit 68324eff2f

@ -128,7 +128,7 @@ def CheckAuthorizedAuthor(input_api, output_api, bot_allowlist=None):
input_api.PresubmitLocalPath(), 'AUTHORS')
valid_authors = (
input_api.re.match(r'[^#]+\s+\<(.+?)\>\s*$', line)
for line in open(authors_path))
for line in open(authors_path, encoding="utf-8"))
valid_authors = [item.group(1).lower() for item in valid_authors if item]
if not any(input_api.fnmatch.fnmatch(author.lower(), valid)
for valid in valid_authors):

Loading…
Cancel
Save