commit | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [log] [tgz] |
---|---|---|
author | Mike Frysinger <vapier@chromium.org> | Thu Jul 11 08:22:22 2019 |
committer | Dirk Pranke <dpranke@chromium.org> | Thu Jul 11 22:44:41 2019 |
tree | 5854b9b9b493426b00c0eec02a6e764ca77fac53 | |
parent | 12ef00dfaa08ef6d71355b874162c0da1fa24b3a [diff] |
fix encoding issues with inputs for better Python 3 support When running subprocesses like '!<(which foo)', we return subprocess's stdout contents as bytes, not as a string. Make sure we decode it into UTF-8 first. When reading gyp files, we don't specify an encoding, so the default might be ASCII which breaks when the gyp files contain UTF-8. Change it to always read it as a binary stream before decoding to UTF-8. With those fixes in place, we need to rework all the type checks for strings & numbers. Introduce some aliases to the right set of types for the active version of Python, and then change all the type checks to use isinstance. Bug: 926296 Test: building CrOS gyp packages with python3 works again Test: `./gyptest.py -a` mostly passes (4 failures look toolchain related) Change-Id: I416acf140d01948748f5cc09e966b52f166b82d0 Reviewed-on: https://chromium-review.googlesource.com/c/external/gyp/+/1697943 Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Documents are available at gyp.gsrc.io, or you can check out md-pages
branch to read those documents offline.