Mention limit in error message

This commit is contained in:
Andrew Murray 2024-09-18 20:56:55 +10:00
parent 08d9c89d8a
commit 9135fd0fb2

View File

@ -140,7 +140,7 @@ def _safe_zlib_decompress(s: bytes) -> bytes:
dobj = zlib.decompressobj() dobj = zlib.decompressobj()
plaintext = dobj.decompress(s, MAX_TEXT_CHUNK) plaintext = dobj.decompress(s, MAX_TEXT_CHUNK)
if dobj.unconsumed_tail: if dobj.unconsumed_tail:
msg = "Decompressed Data Too Large" msg = "Decompressed data too large for PngImagePlugin.MAX_TEXT_CHUNK"
raise ValueError(msg) raise ValueError(msg)
return plaintext return plaintext