--- a/buildtools/linux64/clang-format.orig 2021-08-23 09:18:56.269570955 +0200 +++ b/buildtools/linux64/clang-format 2021-08-23 09:17:55.531190516 +0200 @@ -10,9 +10,9 @@ args = sys.argv[1:] inputfiles = [a for a in args if not a.startswith('-')] -contents = '' +contents = b'' if '-' in args or not inputfiles: - contents = sys.stdin.read() + contents = sys.stdin.buffer.read() # Tarball builds may or may not have depot_tools in $PATH. In the former case, # running 'clang-format' will call back into this script infinitely. Strip off @@ -34,8 +34,8 @@ stdout, stderr = proc.communicate(input=contents) # Ignore if clang-format fails. Eg: it may be too old to support C++14. if proc.returncode == 0: - sys.stdout.write(stdout) - sys.stderr.write(stderr) + sys.stdout.buffer.write(stdout) + sys.stderr.buffer.write(stderr) sys.exit(0) except OSError: # Ignore if clang-format is not installed.