-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
After PR #5098:
$ 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:
Lines 41 to 50 in 5673090
| class _imagingft_not_installed: | |
| # module placeholder | |
| def __getattr__(self, id): | |
| raise ImportError("The _imagingft C module is not installed") | |
| try: | |
| from . import _imagingft as core | |
| except ImportError: | |
| core = _imagingft_not_installed() |
Originally posted by @eli-schwartz in #5098 (comment)
Metadata
Metadata
Assignees
Labels
No labels