Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate encoder error codes to strings; deprecate ImageFile.raise_oserror() #7609

Merged
merged 2 commits into from Dec 13, 2023

Commits on Dec 13, 2023

  1. Translate encoder error codes to strings

    When decoding, we use raise_oserror() to convert codec error codes to
    strings.  Adapt that code to be used when encoding as well.  Add a new
    helper function that returns the exception so we can still raise
    `from exc`.
    bgilbert committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    ec17dc1 View commit details
    Browse the repository at this point in the history
  2. Deprecate raise_oserror() for removal in Pillow 12

    It's only useful if the caller has an IMAGING_CODEC_* error code, which
    are only produced by codec decode() methods and are automatically
    translated by ImageFile.
    
    Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
    bgilbert and radarhere committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    e1fb1ab View commit details
    Browse the repository at this point in the history