From 0568292553ce2deaba9ef8fe013c96c7b7466caa Mon Sep 17 00:00:00 2001 From: Sam Mason Date: Fri, 7 Jul 2023 13:36:26 +0100 Subject: [PATCH] include exception in warning message --- src/PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 4f53f32db..5439e3b8f 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -519,7 +519,7 @@ def _encode_ipython_image(image, image_format): try: image.save(b, image_format) except Exception as e: - warnings.warn(f"failed to encode image as {image_format}") + warnings.warn(f"failed to encode image as {image_format}: {e}") return None return b.getvalue()