Parse .mojom as UTF-8.
The parser called on the changed line demands a Python |str| type, but |contents| here can be a |unicode|. The |str| converter in Python 2 assumes an ASCII encoding and thus throws an exception if any characters are > 127. This means that any changed .mojo files that contain non-ASCII characters cause a presubmit error. One can't remove those characters either because the presubmit parses the previous version of the file too. Thus all changes to .mojo file with non-ASCII characters are blocked without this. Change-Id: I887890590c8ad97a4fac60d19a8bebce439abacc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2223973 Commit-Queue: Adam Langley <agl@chromium.org> Auto-Submit: Adam Langley <agl@chromium.org> Reviewed-by:Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#773768}
Showing
Please register or sign in to comment