diff options
| author | Tulir Asokan <tulir@maunium.net> | 2021-10-03 11:49:53 +0300 |
|---|---|---|
| committer | Tulir Asokan <tulir@maunium.net> | 2021-10-03 11:49:53 +0300 |
| commit | f29c165357ed116ba0af2f8589ae0a10d959e7e2 (patch) | |
| tree | c4ef23892f0bfd5d946bcaae7eae3f28fa177dcd /sticker/pack.py | |
| parent | ec8eeeeaf526a122008aace7c71e5472bce832e6 (diff) | |
| parent | 569d9815c65efe14e9ffba0899600a557269c7a6 (diff) | |
Merge remote-tracking branch 'aWeinzierl/fix-encoding'
Diffstat (limited to 'sticker/pack.py')
| -rw-r--r-- | sticker/pack.py | 6 |
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) |
