aboutsummaryrefslogtreecommitdiffstats
path: root/sticker/scalar_convert.py
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2021-10-03 11:49:53 +0300
committerTulir Asokan <tulir@maunium.net>2021-10-03 11:49:53 +0300
commitf29c165357ed116ba0af2f8589ae0a10d959e7e2 (patch)
treec4ef23892f0bfd5d946bcaae7eae3f28fa177dcd /sticker/scalar_convert.py
parentec8eeeeaf526a122008aace7c71e5472bce832e6 (diff)
parent569d9815c65efe14e9ffba0899600a557269c7a6 (diff)
Merge remote-tracking branch 'aWeinzierl/fix-encoding'
Diffstat (limited to 'sticker/scalar_convert.py')
-rw-r--r--sticker/scalar_convert.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sticker/scalar_convert.py b/sticker/scalar_convert.py
index 69f7220..76a0101 100644
--- a/sticker/scalar_convert.py
+++ b/sticker/scalar_convert.py
@@ -19,12 +19,12 @@ import json
index_path = "../web/packs/index.json"
try:
- with open(index_path) as index_file:
+ with util.open_utf8(index_path) as index_file:
index_data = json.load(index_file)
except (FileNotFoundError, json.JSONDecodeError):
index_data = {"packs": []}
-with open(sys.argv[-1]) as file:
+with util.open_utf8(sys.argv[-1]) as file:
data = json.load(file)
for pack in data["assets"]:
@@ -45,12 +45,12 @@ for pack in data["assets"]:
}
filename = f"scalar-{pack['name'].replace(' ', '_')}.json"
pack_path = f"web/packs/{filename}"
- with open(pack_path, "w") as pack_file:
+ with util.open_utf8(pack_path, "w") as pack_file:
json.dump(pack_data, pack_file)
print(f"Wrote {title} to {pack_path}")
if filename not in index_data["packs"]:
index_data["packs"].append(filename)
-with open(index_path, "w") as index_file:
+with util.open_utf8(index_path, "w") as index_file:
json.dump(index_data, index_file, indent=" ")
print(f"Updated {index_path}")
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage