Skip to content
New issue

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

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

Already on GitHub? # to your account

Raise DeprecationWarning on raise_ioerror #48

Merged
merged 3 commits into from
Apr 7, 2020

Conversation

radarhere
Copy link

Helps python-pillow#4536

This is in support of 1, keep raise_ioerror and raise a deprecation warning.

I was thinking that 2, making it private, would be not ideal if someone was creating their own plugin and found some need for it.

Then I found that TiffImagePlugin raises an OSError in the same way that ImageFile does/will - https://github.com/python-pillow/Pillow/blob/a8a4b9bfdbf36ab964f57b34d1e1733d232b6175/src/PIL/TiffImagePlugin.py#L1181-L1182. If not for the fact that we are concerned with backwards compatibility, I'd suggest we change the TiffImagePlugin line from raise OSError(err) to ImageFile.raise_oserror(err).

So yes, I think the raise_oserror function could still be useful external to ImageFile.

@hugovk
Copy link
Owner

hugovk commented Apr 7, 2020

Sounds good!

Let's also add it to docs/deprecations.rst

@radarhere
Copy link
Author

Okay, I've added another commit.

Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
@hugovk hugovk merged commit e8dc313 into hugovk:oserror Apr 7, 2020
@hugovk
Copy link
Owner

hugovk commented Apr 7, 2020

Thank you!

@radarhere radarhere deleted the oserror branch April 7, 2020 21:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants