diff options
author | Craig Scott <craig.scott@crascit.com> | 2023-04-07 08:14:18 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2023-04-07 08:14:18 (GMT) |
commit | 0de00b8b69716c0d580f5e06a7eeeaf63b3b7036 (patch) | |
tree | 7e1b998768bd355e3962389c977dc25a83a7158c /Utilities | |
parent | f0d6010cb58b9ca707e696b2e97594481fc3c545 (diff) | |
download | CMake-0de00b8b69716c0d580f5e06a7eeeaf63b3b7036.zip CMake-0de00b8b69716c0d580f5e06a7eeeaf63b3b7036.tar.gz CMake-0de00b8b69716c0d580f5e06a7eeeaf63b3b7036.tar.bz2 |
Sphinx: Modernize UTF-8 encoding handling when updating CMake.qhp
Diffstat (limited to 'Utilities')
-rwxr-xr-x | Utilities/Sphinx/create_identifiers.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py index 0ff39a0..61dd819 100755 --- a/Utilities/Sphinx/create_identifiers.py +++ b/Utilities/Sphinx/create_identifiers.py @@ -6,12 +6,12 @@ if len(sys.argv) != 2: sys.exit(-1) name = sys.argv[1] + "/CMake.qhp" -f = open(name, "rb") +f = open(name, "r", encoding="utf-8") if not f: sys.exit(-1) -lines = f.read().decode("utf-8").splitlines() +lines = f.read().splitlines() if not lines: sys.exit(-1) @@ -47,5 +47,5 @@ for line in lines: line = part1 + prefix + "id=\"" + domain_object_type + "/" + domain_object + "\" " + part2 newlines.append(line + "\n") -f = open(name, "wb") -f.writelines(map(lambda line: line.encode("utf-8"), newlines)) +f = open(name, "w", encoding="utf-8") +f.writelines(newlines) |