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.
The comments look misplaced now. Maybe add it next to the first io.open and end with "Here and elsewhere"?