summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJean Abou Samra <jean@abou-samra.fr>2023-01-30 03:11:54 +0100
committerGeorg Brandl <georg@python.org>2023-01-31 16:30:11 +0100
commitb69cae00b4a13cf306ec92d169b81c965a0865fc (patch)
treea6bef750d9fd875d56ddb50279d151dce58ffe3c /scripts
parent94566ea3bf85190f21cb347ef5df7e5033e43b0f (diff)
downloadpygments-git-b69cae00b4a13cf306ec92d169b81c965a0865fc.tar.gz
Fix lots of missing encoding="utf-8" parameters
Some of these are probably unnecessary (ASCII-only content), but it's easier not to think about it.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/get_css_properties.py2
-rw-r--r--scripts/utility.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/get_css_properties.py b/scripts/get_css_properties.py
index 3afe98e1..85a077aa 100644
--- a/scripts/get_css_properties.py
+++ b/scripts/get_css_properties.py
@@ -28,6 +28,6 @@ if __name__ == "__main__":
data = json.load(data_request)
names = set([p['property'] for p in data if p['property'] != '--*'])
- with open('../pygments/lexers/_css_builtins.py', 'w') as builtin_file:
+ with open('../pygments/lexers/_css_builtins.py', 'w', encoding='utf-8') as builtin_file:
builtin_file.write(HEADER)
builtin_file.write(format_lines('_css_properties', sorted(names)))
diff --git a/scripts/utility.py b/scripts/utility.py
index 4d59a1b2..48056f2c 100644
--- a/scripts/utility.py
+++ b/scripts/utility.py
@@ -21,7 +21,7 @@ def unpack_output_file(path):
skip_until_tokens = path.endswith('.txt')
- for linenumber, line in enumerate(open(path).readlines()):
+ for linenumber, line in enumerate(open(path, encoding='utf-8').readlines()):
line = line.strip()
if not line:
continue