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/stickerimport.py | |
| parent | ec8eeeeaf526a122008aace7c71e5472bce832e6 (diff) | |
| parent | 569d9815c65efe14e9ffba0899600a557269c7a6 (diff) | |
Merge remote-tracking branch 'aWeinzierl/fix-encoding'
Diffstat (limited to 'sticker/stickerimport.py')
| -rw-r--r-- | sticker/stickerimport.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sticker/stickerimport.py b/sticker/stickerimport.py index 6846184..c852e78 100644 --- a/sticker/stickerimport.py +++ b/sticker/stickerimport.py @@ -71,7 +71,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir already_uploaded = {} try: - with open(pack_path) as pack_file: + with util.open_utf8(pack_path) as pack_file: existing_pack = json.load(pack_file) already_uploaded = {int(sticker["net.maunium.telegram.sticker"]["id"]): sticker for sticker in existing_pack["stickers"]} @@ -99,7 +99,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir doc["body"] = sticker.emoticon doc["net.maunium.telegram.sticker"]["emoticons"].append(sticker.emoticon) - with open(pack_path, "w") as pack_file: + with util.open_utf8(pack_path, "w") as pack_file: json.dump({ "title": pack.set.title, "id": f"tg-{pack.set.id}", |
