From 344e52fac5d7cb870cfd683dc9ff67b7443633e9 Mon Sep 17 00:00:00 2001 From: _run Date: Thu, 10 Oct 2024 17:51:38 +0400 Subject: [PATCH] Fix pickle issue with saving data on async --- telebot/asyncio_storage/pickle_storage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telebot/asyncio_storage/pickle_storage.py b/telebot/asyncio_storage/pickle_storage.py index 723672034..1a63e6961 100644 --- a/telebot/asyncio_storage/pickle_storage.py +++ b/telebot/asyncio_storage/pickle_storage.py @@ -265,9 +265,9 @@ async def save( message_thread_id, bot_id, ) - data = await self._read_from_file() - data[_key]["data"] = data - await self._write_to_file(data) + file_data = await self._read_from_file() + file_data[_key]["data"] = data + await self._write_to_file(file_data) return True def __str__(self) -> str: