[all-commits] [llvm/llvm-project] 8f4e6c: [clang-format] Use utf-8 for JSON object load

Amy Wang via All-commits all-commits at lists.llvm.org
Mon Sep 5 07:41:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f4e6cfe73d803697470e817845d9b94c4530ca3
      https://github.com/llvm/llvm-project/commit/8f4e6cfe73d803697470e817845d9b94c4530ca3
  Author: Amy Wang <kai.ting.wang at huawei.com>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

  Changed paths:
    M clang/tools/clang-format/clang-format.py

  Log Message:
  -----------
  [clang-format] Use utf-8 for JSON object load

>From Python 3.6 and above, it should be able to automatically select a
decoding for json.loads. However, with a vim encoding that defaults
to utf-8, clang-format.py runs into the following error

    TypeError: the JSON object must be str, not 'bytes'

This patch explicitly specifies utf-8 decoding for the header.

Reviewed by: ldrumm, sammcall

Differential Revision: https://reviews.llvm.org/D133236




More information about the All-commits mailing list