diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index 6f4edd04..a5eed2a4 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -39,7 +39,7 @@ def _resize_photo_if_needed( or (isinstance(file, io.IOBase) and not file.seekable())): return file - before = file.tell() if isinstance(file, io.IOBase) else None + before = file.tell() if isinstance(file, io.IOBase) else 0 if isinstance(file, bytes): file = io.BytesIO(file)