Skip to content
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

Pillow version > 9 not accepted #4651

Closed
sysrun opened this issue Jul 3, 2023 · 1 comment · Fixed by esphome/esphome#5071
Closed

Pillow version > 9 not accepted #4651

sysrun opened this issue Jul 3, 2023 · 1 comment · Fixed by esphome/esphome#5071

Comments

@sysrun
Copy link

sysrun commented Jul 3, 2023

The problem

Tried to use a Font and installed pillow version 10.0.0

At compile esphome will fail with error "Please update your pillow installation to at least 4.0.x. "

Problem ist this check in "components/font/init.py""
if PIL.__version__[0] < "4":

The version is 10.0.0

As only the first character is tested, the version is detected as 1

Which version of ESPHome has the issue?

2023.6.3

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

No response

Component causing the issue

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@jklap
Copy link

jklap commented Jul 3, 2023

Suggested solution:

components/font/__init__.py:

from packaging import version

Line 73:

    if version.parse(PIL.__version__) < version.parse("4.0.0"):

Current code assumes first character is the version -- fails when the version is actually "10.0.0" as it reads it as "1"

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants