-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: account for deprecations of constant in Pillow 9.1 #22766
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
Conversation
palette=Image.ADAPTIVE, colors=num_colors) | ||
# These constants were converted to IntEnums and deprecated in | ||
# Pillow 9.2 | ||
dither = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this style is odd, but these names a very long and this code is very indented.
I also tried
dither = (
Image.Dither.NONE
if hasattr(Image, 'Dither')
else Image.NONE
)
and liked that worse.
also tried doing this in-line in the function call, but that was also (subjectively) worse to my eye.
I have also just started seeing these temp file related failures locally (they go away on re-running). I had hoped it was because I was running too many unstable things, seeing if I can track this down... |
This was a typo in the pillow docs: python-pillow/Pillow#6171 |
https://pillow.readthedocs.io/en/stable/deprecations.html#constants https://pillow.readthedocs.io/en/stable/releasenotes/9.1.0.html#constants Image.None -> Image.Dither.None Image.ADAPTIVE -> Image.Palette.ADAPTIVE
f219f8a
to
8b0d527
Compare
Why pin if the rest is going to fix it? |
8b0d527
to
e3fea7e
Compare
because it didn't fix it, some how bumping pillow exposed a leaking temporary directory... |
8000
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
…766-on-v3.5.x Backport PR #22766 on branch v3.5.x (FIX: account for constant deprecations in Pillow 9.1)
Re-reading the title of this issue. I just want to be clear this is about the deprecation of constants in Pillow, not a frequent stream of deprecations in Pillow.... |
https://pillow.readthedocs.io/en/stable/deprecations.html#constants
Image.None -> Image.Dither.None
Image.ADAPTIVE -> Image.Palette.ADAPTIVE
PR Summary
un-break CI by not triggering warnings from Pilllow
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).