aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Weinzierl <20560137+aWeinzierl@users.noreply.github.com>2021-01-27 22:09:15 +0100
committerAndreas Weinzierl <20560137+aWeinzierl@users.noreply.github.com>2021-01-27 22:09:15 +0100
commitb884a9c3874cfe0eb885bf2b8eaa46a628a9f4a3 (patch)
tree6c6aecfd4e45da29505161b2a6cdd9fd91cf095e
parentba0096275ce966107b9a00f42e9894af74cebb4c (diff)
Set encoding to utf-8 when saving json file for stickerpack
Fixes UnicodeEncodeError with Windows 10 when trying to import sticker packs caused by the default encoding scheme in Windows
-rw-r--r--sticker/stickerimport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sticker/stickerimport.py b/sticker/stickerimport.py
index 6846184..1bff240 100644
--- a/sticker/stickerimport.py
+++ b/sticker/stickerimport.py
@@ -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 open(pack_path, "w", encoding="utf-8") as pack_file:
json.dump({
"title": pack.set.title,
"id": f"tg-{pack.set.id}",
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage