aboutsummaryrefslogtreecommitdiffstats
path: root/sticker/pack.py
diff options
context:
space:
mode:
authorAndreas Weinzierl <20560137+aWeinzierl@users.noreply.github.com>2021-01-27 23:31:33 +0100
committerAndreas Weinzierl <20560137+aWeinzierl@users.noreply.github.com>2021-01-27 23:31:33 +0100
commit0f7b678f5776a940b590e55381eba5ccb511d9d7 (patch)
tree56501a9cb8ba5b5fc84c3a264d45dd3fec052a04 /sticker/pack.py
parentb884a9c3874cfe0eb885bf2b8eaa46a628a9f4a3 (diff)
Use utf8-encoding whenever JSON is processed
Diffstat (limited to 'sticker/pack.py')
-rw-r--r--sticker/pack.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sticker/pack.py b/sticker/pack.py
index e611b73..f082370 100644
--- a/sticker/pack.py
+++ b/sticker/pack.py
@@ -93,7 +93,7 @@ async def main(args: argparse.Namespace) -> None:
dirname = os.path.basename(os.path.abspath(args.path))
meta_path = os.path.join(args.path, "pack.json")
try:
- with open(meta_path) as pack_file:
+ with util.open_utf8(meta_path) as pack_file:
pack = json.load(pack_file)
print(f"Loaded existing pack meta from {meta_path}")
except FileNotFoundError:
@@ -112,14 +112,14 @@ async def main(args: argparse.Namespace) -> None:
if sticker:
pack["stickers"].append(sticker)
- with open(meta_path, "w") as pack_file:
+ with util.open_utf8(meta_path, "w") as pack_file:
json.dump(pack, pack_file)
print(f"Wrote pack to {meta_path}")
if args.add_to_index:
picker_file_name = f"{pack['id']}.json"
picker_pack_path = os.path.join(args.add_to_index, picker_file_name)
- with open(picker_pack_path, "w") as pack_file:
+ with util.open_utf8(picker_pack_path, "w") as pack_file:
json.dump(pack, pack_file)
print(f"Copied pack to {picker_pack_path}")
util.add_to_index(picker_file_name, args.add_to_index)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage