Fix telegram bot send_document (#118616)

This commit is contained in:
Luca Angemi 2024-06-02 08:32:24 +02:00 committed by GitHub
parent 46eb779c5c
commit d67ed42edc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -287,7 +287,9 @@ SERVICE_MAP = {
def _read_file_as_bytesio(file_path: str) -> io.BytesIO:
"""Read a file and return it as a BytesIO object."""
with open(file_path, "rb") as file:
return io.BytesIO(file.read())
data = io.BytesIO(file.read())
data.name = file_path
return data
async def load_data(