Please sign in to comment.
Fix MemoryError on get_input_media(game)
Because an integer was being passed where a TLObject was expected, so the serialization with bytes() was actually requesting that many bytes as opposed to properly converting the expected object.
- Loading branch information
Showing with 25 additions and 3 deletions.
|@@ -0,0 +1,18 @@|
|from telethon import utils|
|from telethon.tl.types import (|
|MessageMediaGame, Game, PhotoEmpty|
|large_long = 2**62|
|media = MessageMediaGame(Game(|
|id=large_long, # <- key to trigger `MemoryError`|
|input_media = utils.get_input_media(media)|
|bytes(input_media) # <- shouldn't raise `MemoryError`|