Skip to content

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 <[email protected]>
@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
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