To add another data point: I'm able to reproduce the failure with a self-compiled Python 3.5.9 that I have laying around for testing. The reason is that the latest commit in master has a non-ASCII character in the first line of its commit message [1]. Applying the change to open_write_file solves the issue for me. I'm for pushing this immediately to unblock testing.
1: As a side note, this means there's a very funny workaround: Just push *any* commit to master with a pure ASCII description and you'll not see the failure anymore :D https://codereview.appspot.com/563810043/diff/545810044/scripts/build/output-distance.py File scripts/build/output-distance.py (right): https://codereview.appspot.com/563810043/diff/545810044/scripts/build/output-distance.py#newcode1305 scripts/build/output-distance.py:1305: return open (x, 'w', encoding="utf-8") Please change to single quotes to at least conform with the style of this function. We're doing a very bad job at this; we should likely decide on one style and change it everywhere... https://codereview.appspot.com/563810043/