Merge pull request #8660 from HarmvandenBrand/tiff_plugin_error_msg

This commit is contained in:
Hugo van Kemenade 2025-01-08 18:59:31 +02:00 committed by GitHub
commit a9dcac0f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -1146,7 +1146,7 @@ class TestFileLibTiff(LibTiffTestCase):
im.load()
# Assert that the error code is IMAGING_CODEC_MEMORY
assert str(e.value) == "-9"
assert str(e.value) == "decoder error -9"
@pytest.mark.parametrize("compression", ("tiff_adobe_deflate", "jpeg"))
def test_save_multistrip(self, compression: str, tmp_path: Path) -> None:

View File

@ -1406,7 +1406,8 @@ class TiffImageFile(ImageFile.ImageFile):
self.fp = None # might be shared
if err < 0:
raise OSError(err)
msg = f"decoder error {err}"
raise OSError(msg)
return Image.Image.load(self)