Raise DeprecationWarning on raise_ioerror #48
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
toImageFile.raise_oserror(err)
.So yes, I think the
raise_oserror
function could still be useful external toImageFile
.