FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve error messages from C by akx · Pull Request #9784 · python-pillow/Pillow · GitHub

Improve error messages from C - #9784

Open
akx wants to merge 8 commits into
python-pillow:mainfrom
akx:wrong-mode-exc
Open

Improve error messages from C#9784
akx wants to merge 8 commits into
python-pillow:mainfrom
akx:wrong-mode-exc

Conversation

akx commented Jul 9, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Inspired by #6667 (comment)

  • New internal exception type NotSupportedError for operations that are currently not supported; derives from both ValueError and NotImplementedError for backward compatibility.
    • Deriving from NotImplementedError allows for try-excepting in tests, so we can do better than (e.g.) Tests.test_image_filter.test_sanity where the test just quietly does nothing when a mode combo is not (yet, or currently) supported. (This wasn't wired up here yet.)
  • The internal ImagingError_*() C APIs now all support an optional message text, and message texts were added where practical. No longer "image has wrong mode" or "images do not match" for everything! ✨
  • Image nullness checks used to occasionally do ModeErrors, occasionally ValueErrors; now they're all ValueError.

akx marked this pull request as ready for review July 9, 2026 11:59
Comment thread src/libImaging/Reduce.c Outdated
akx force-pushed the wrong-mode-exc branch 3 times, most recently from fbf0a1d to 5b9e30f Compare July 20, 2026 07:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL