Task exception was never retrieved
future: <Task finished name='Task-18' coro=<Dispatcher._process_polling_updates() done, defined at /Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py:407> exception=ValueError('I/O operation on closed file')>
Traceback (most recent call last):
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 415, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 283, in process_update
return await self.callback_query_handlers.notify(update.callback_query)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/Users/andy/PycharmProjects/mfbot/main.py", line 143, in picture
await bot.send_photo(chat_id=callback.message.chat.id, photo=photo)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/bot/bot.py", line 565, in send_photo
result = await self.request(api.Methods.SEND_PHOTO, payload, files)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/bot/base.py", line 236, in request
return await api.make_request(await self.get_session(), self.server, self.__token, method, data, files,
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiogram/bot/api.py", line 139, in make_request
async with session.post(url, data=req, **kwargs) as response:
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/client.py", line 1141, in __aenter__
self._resp = await self._coro
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/client.py", line 508, in _request
req = self._request_class(
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 313, in __init__
self.update_body_from_data(data)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 505, in update_body_from_data
body = body()
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/formdata.py", line 170, in __call__
return self._gen_form_data()
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/formdata.py", line 163, in _gen_form_data
self._writer.append_payload(part)
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/multipart.py", line 829, in append_payload
size = payload.size
File "/Users/andy/PycharmProjects/mfbot/venv/lib/python3.9/site-packages/aiohttp/payload.py", line 379, in size
return os.fstat(self._value.fileno()).st_size - self._value.tell()
ValueError: I/O operation on closed file