-
- Downloads
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>
Loading
Please register or sign in to comment