From Python 3.6 and above, it should be able to automatically select a decoding for the json.loads. However, with a vim encoding that defaults to utf-8, the clang-format.py runs into the following error. The patch explicit specifies to use use utf-8 decoding for header.
Traceback (most recent call last):
File "<string>", line 1, in <module> File "/home/k00375917/sycl_workspace/llvm/clang/tools/clang-format/clang-format.py", line 156, in <module> main() File "/home/k00375917/sycl_workspace/llvm/clang/tools/clang-format/clang-format.py", line 137, in main header = json.loads(header) File "/usr/lib/python3.5/json/__init__.py", line 312, in loads s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'