[clang-tidy] Always open files using UTF-8 encoding
The encoding used for opening files depends on the OS and might be different from UTF-8 (e.g. on Windows it can be CP-1252). The documentation files use UTF-8 and might be incompatible with other encodings. For example, right now `clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst` has non-ASCII quotes and running `add_new_check.py` fails on Windows, because it tries to read the file with incompatible encoding. Use `io.open` for compatibility with both Python 2 and Python 3. Reviewed By: kbobyrev Differential Revision: https://reviews.llvm.org/D106792
parent
7c6cca4b
Please register or sign in to comment