abouttreesummaryrefslogcommitdiff
path: root/check_layout.py
diff options
context:
space:
mode:
authorAutissima2025-09-03 22:41:10 +0200
committerGitHub2025-09-03 22:41:10 +0200
commit5b3dc8d5ed4d73d5fa7bb8028d467a923dfbd191 (patch)
tree8e7833bf62101f73a699de8ed1d76e667796008b /check_layout.py
parent795889bf813d5c561725c2ca39597d04f33a63cd (diff)
downloadunexpected-keyboard-5b3dc8d5ed4d73d5fa7bb8028d467a923dfbd191.tar.gz
unexpected-keyboard-5b3dc8d5ed4d73d5fa7bb8028d467a923dfbd191.zip
Python script encoding fix (#1093)
* Changed Python scripts so they work on my machine file open() used default encoding (cp1252 on my machine) but the text is utf-8, had to specify encoding in check_layout.py
Diffstat (limited to 'check_layout.py')
-rw-r--r--check_layout.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/check_layout.py b/check_layout.py
index 0208a97..5f90927 100644
--- a/check_layout.py
+++ b/check_layout.py
@@ -116,7 +116,7 @@ def check_layout(layout):
# Fill 'known_keys', which is used for some checks
def parse_known_keys():
global known_keys
- with open("srcs/juloo.keyboard2/KeyValue.java", "r") as f:
+ with open("srcs/juloo.keyboard2/KeyValue.java", "r", encoding="utf-8") as f:
known_keys = set(
( m.group(1) for m in re.finditer('case "([^"]+)":', f.read()) )
)
@@ -134,6 +134,6 @@ for fname in sorted(glob.glob("srcs/layouts/*.xml")):
else:
check_layout(layout)
-with open("check_layout.output", "w") as out:
+with open("check_layout.output", "w", encoding="utf-8") as out:
for w in warnings:
print(w, file=out)