Avoid another MemoryError

This commit is contained in:
Lonami Exo
2020-02-28 10:42:23 +01:00
parent 673a2ecd5d
commit e451abbf20
5 changed files with 30 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
import pytest
from telethon.tl import types, functions
def test_nested_invalid_serialization():
large_long = 2**62
request = functions.account.SetPrivacyRequest(
key=types.InputPrivacyKeyChatInvite(),
rules=[types.InputPrivacyValueDisallowUsers(users=[large_long])]
)
with pytest.raises(TypeError):
bytes(request)