summaryrefslogtreecommitdiff
path: root/Utilities
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2023-04-07 18:14:18 +1000
committerCraig Scott <craig.scott@crascit.com>2023-04-07 18:14:18 +1000
commit0de00b8b69716c0d580f5e06a7eeeaf63b3b7036 (patch)
tree7e1b998768bd355e3962389c977dc25a83a7158c /Utilities
parentf0d6010cb58b9ca707e696b2e97594481fc3c545 (diff)
downloadcmake-0de00b8b69716c0d580f5e06a7eeeaf63b3b7036.tar.gz
Sphinx: Modernize UTF-8 encoding handling when updating CMake.qhp
Diffstat (limited to 'Utilities')
-rwxr-xr-xUtilities/Sphinx/create_identifiers.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py
index 0ff39a0c2a..61dd819b42 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)