From f5e893e46e869a9e275298207c70cf915173a072 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2026 09:46:09 +1100 Subject: [PATCH] Seek raises OverFlowError on 32-bit --- Tests/test_file_psd.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Tests/test_file_psd.py b/Tests/test_file_psd.py index a5223cace..538b1406b 100644 --- a/Tests/test_file_psd.py +++ b/Tests/test_file_psd.py @@ -12,7 +12,6 @@ from .helper import ( assert_image_similar, hopper, is_pypy, - is_win32, ) test_file = "Tests/images/hopper.psd" @@ -213,15 +212,15 @@ def test_bounds_crash(test_file: str) -> None: im.load() -@pytest.mark.skipif( - is_win32() and sys.version_info < (3, 11), - reason="OverflowError on Windows Python 3.10", -) def test_bounds_crash_overflow() -> None: with Image.open("Tests/images/psd-oob-write-overflow.psd") as im: assert isinstance(im, PsdImagePlugin.PsdImageFile) im.load() - im.seek(im.n_frames) + if sys.maxsize <= 2**32: + with pytest.raises(OverflowError): + im.seek(im.n_frames) + else: + im.seek(im.n_frames) - with pytest.raises(ValueError): - im.load() + with pytest.raises(ValueError): + im.load()