Closed zotho closed 4 years ago
Сorrectly working example:
result_buffer.seek(0)
bot.send_file("@user", result_buffer)
I think that in case I forget to call seek(0)
UnboundLocalError
is wrong exception
The problem was the library was skipping a fair bit of code that is necessary when file_size
was specified. The library won't seek(0)
to send files. That's something the user has to decide (whether this is a good decision is another story, and changing it would be a breaking change).
Forgot to mention in the commit, but this is closed by 219b4ecb77ae1b97259ed302c63285daa32aea08.
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip
and triggered the bug in the latest version.Code that causes the issue
Traceback