Fix GetPylint with USE_PYTHON3=True

kwargs['stdin'] is passed in to subprocess communicate(), which
expects bytes, not str.

Bug: 1215602
Change-Id: I95326eed08cffecd31abc6b0380de2a3c2ff3dd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2929386
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Dan H <harringtond@chromium.org>
changes/86/2929386/5
Dan Harrington 4 years ago committed by LUCI CQ
parent 93c73563c5
commit a0b0f12874

@ -944,6 +944,7 @@ def GetPylint(input_api,
input_api.logging.debug(' with extra PYTHONPATH: %r', extra_paths_list)
def GetPylintCmd(flist, extra, parallel):
import sys
# Windows needs help running python files so we explicitly specify
# the interpreter to use. It also has limitations on the size of
# the command-line, so we pass arguments via a pipe.
@ -975,6 +976,8 @@ def GetPylint(input_api,
description += ' on %d cores' % input_api.cpu_count
kwargs['stdin'] = '\n'.join(args + flist)
if sys.version_info.major != 2:
kwargs['stdin'] = kwargs['stdin'].encode('utf-8')
return input_api.Command(
name='Pylint (%s)' % description,

Loading…
Cancel
Save