-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
10.0.0 ~regression~ deprecation: ImageDraw' object has no attribute 'textsize' #7277
Comments
I suspect the current sphinxcontrib-blockdiag could simply be incompatible with 10.0.0? |
streamdeck_ui was broken by the removal of "textsize". I fixed the problem by backrevving, but I would imagine many other applications that rely on your library are also broken. |
We aim to deprecate for at least a year, with deprecation warnings, so people have notice and plenty of time to upgrade. And then remove the deprecations in major releases, following SemVer.
And it was removed in Pillow 10.0.0, released on 1st July 2023:
Python 3.11.4 (v3.11.4:d2340ef257, Jun 6 2023, 19:15:51) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image, ImageDraw
>>> Image.__version__
'9.5.0'
>>> im = Image.new("RGB", (100, 100))
>>> draw = ImageDraw.Draw(im)
>>> draw.textsize("Hello")
<stdin>:1: DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.
(30, 11)
>>> Please report to the relevant upstream projects. I see there's already one for streamdeck_ui: And for sphinxcontrib-blockdiag, the sof-docs dependency: |
Thanks, this is typically why we run But in this case it makes no difference because Worse: sphinx-build somehow hides this warning. I tried
Is such a warning even printed on stderr? |
Deprecation warnings are printed to stderr during normal execution: ❯ cat 1.py
from PIL import Image, ImageDraw
print(Image.__version__)
im = Image.new("RGB", (100, 100))
draw = ImageDraw.Draw(im)
draw.textsize("Hello")
❯ python 1.py
9.5.0
/private/tmp/1.py:5: DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.
draw.textsize("Hello")
❯ python 1.py > 1.txt
/private/tmp/1.py:5: DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.
draw.textsize("Hello") And they're printed to sdtout in a special warnings summary by pytest: ❯ cat test_1.py
def test_1():
from PIL import Image, ImageDraw
print(Image.__version__)
im = Image.new("RGB", (100, 100))
draw = ImageDraw.Draw(im)
draw.textsize("Hello")
❯ pytest test_1.py
============================================================================================ test session starts ============================================================================================
platform darwin -- Python 3.11.3, pytest-7.4.0, pluggy-1.2.0
rootdir: /private/tmp
plugins: flaky-3.7.0, timeout-2.1.0, cov-4.1.0, respx-0.20.1, xdist-3.3.1, anyio-3.6.2, lazy-fixture-0.6.3
collected 1 item
test_1.py . [100%]
============================================================================================= warnings summary ==============================================================================================
test_1.py::test_1
/private/tmp/test_1.py:6: DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.
draw.textsize("Hello")
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================= 1 passed, 1 warning in 0.03s ========================================================================================
❯ pytest test_1.py > 1.txt
I've not checked Sphinx. |
Thanks @hugovk for all the information and pointers, which is exactly what I was hoping to get when I opened this issue. Closing it, we can still discuss and add more pointers after it's closed but it looks like there's nothing required on the pillow side. |
I don't have time to isolate the issue and file a "great" bug report sorry. However this is hopefully a "decent" bug report because everything required to reproduce should be found at thesofproject/sof-docs#472
The moment pillow 10.0.0 was released on PyPI, our build started failing with this warning:
Downgrading to 9.5.0 immediately solved the issue.
The text was updated successfully, but these errors were encountered: