You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python
Python 3.9.4 (default, Apr 20 2021, 15:51:38)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL.ImageFont
>>> PIL.ImageFont.FreeTypeFont()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.9/site-packages/PIL/ImageFont.py", line 173, in __init__
freetype_version = parse_version(features.version_module("freetype2"))
File "/usr/lib/python3.9/site-packages/packaging/version.py", line 57, in parse
return Version(version)
File "/usr/lib/python3.9/site-packages/packaging/version.py", line 296, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
The ImageFont module tries to be accepting of missing (optional) system dependencies for the _imagingft module. But then features.version_module() returns None, which cannot be parsed as a version, so this dumps a completely incomprehensible traceback rather than what most of the rest of this module does, which is:
I had this problem a few days ago and first suspected packaging to be behind it which I reported and having a better error message there might also be a good thing pypa/packaging#434
After PR #5098:
The ImageFont module tries to be accepting of missing (optional) system dependencies for the _imagingft module. But then features.version_module() returns None, which cannot be parsed as a version, so this dumps a completely incomprehensible traceback rather than what most of the rest of this module does, which is:
Pillow/src/PIL/ImageFont.py
Lines 41 to 50 in 5673090
Originally posted by @eli-schwartz in #5098 (comment)
The text was updated successfully, but these errors were encountered: