-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Do not discard error message if _imagingft fails to import #7047
Conversation
Would you mind sharing more specific details about how to replicate the intentional error you tested with? |
I commented out the following lines: Lines 1068 to 1069 in 93afedf
Line 1249 in 93afedf
Lines 1266 to 1267 in 93afedf
Line 1272 in 93afedf
Then installed Pillow from source with pip as usual in a Fedora 26 Docker container which has FreeType 2.7.1. |
I'm trying, but for reasons I don't understand, Pillow still thinks it has access to FreeType 2.12.1. |
It looks like it downloaded the wheel: https://github.com/radarhere/docker-images/actions/runs/4575672322/jobs/8078793400#step:6:10950 For my tests I cloned my branch in $ docker run -it --rm -v ~/pillow:/pillow fedora:26 bash
...
# cat /root/.bash_history
dnf install -y python37 gcc freetype-devel zlib-devel libjpeg-devel
cd /pillow/
python3.7 -m ensurepip
python3.7 -m pip install -U pip setuptools
python3.7 -m pip install . --no-cache-dir --ignore-installed
python3.7 -c "import PIL.ImageFont; PIL.ImageFont.core.test"
python3.7 -m PIL
history -a |
Helps #7040
Changes:
_util.DeferredError
if_imagingft
fails to import instead of a custom helper from before the fork (similarly toImageCms
, added in Readthedocs #600),ImportError
but notModuleNotFoundError
), raise a warning inPIL.features
,FT_LOAD_COLOR
was added in FreeType 2.5, Pillow currently requires FreeType>=2.8 (Remove support for FreeType 2.7 and older #5777)FT_LOAD_TARGET_MONO
version added is undocumented, but has been around since FreeType 2.1.3,#define KEEP_PY_UNICODE
, was only used in filepy3.h
which was removed in Drop support for EOL Python 2.7 #4109I've tested these changes by compiling Pillow in a Fedora 26 Docker container (with FreeType 2.7.1 and no other optional dependencies) with an intentional error in
_imagingft
: