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
Crash when importing ImageFont #6314
Comments
Without an error, this is hard to investigate. Here are some questions
|
|
This is how a C error behaves on Windows. This is most likely an access violation, similar to a segfault on Linux. If you are running from command line you can type It might be possible to get a stack trace using Visual Studio or another debugger, although I'm not sure if the release binaries contain enough debug information to obtain anything usable. |
Here is the result of running
With PyCharm I was not able to get a stack trace. |
As I expected, -1073741819 is C0000005 in hex, which is an Access Violation on Windows.
You would have to use a C debugger (native debugger in Visual Studio, WinDBG, lldb via CLion, etc.), not a Python debugger (PyCharm, etc.). The file |
The import of Image and ImageColor works without an error. ImageColor fails just like ImageDraw. Unfortunately, I'm not able to debug and retrieve a stack trace. |
Could you rephrase this? The first sentence seems to say that ImageColor is fine, then the second sentence says that it fails. Did you mean to say that ImageColor is fine and ImageFont fails? |
Sorry! You are right: The import of ImageFont fails |
I've created #6341 to not import ImageFont by default in ImageDraw. If merged, it will help your situation, but only by avoiding the real problem. |
ImageDraw only started importing ImageFont by default in Pillow 8.3.0 with #5510. So when you said earlier that Pillow 7 and Pillow 8 worked fine, that would be the explanation. If you try and |
I tested |
Nothing in the changelog looks related to me. Seeing this comment, I think #5062 is what triggered it. That issue starts linking to font dependencies dynamically on Windows. @nulano will have a better understanding of this than me, but if I'm right, the release notes for that change would suggest that something is wrong with your |
Yes, I would agree that is the most likely explanation. I did test having the wrong version (x86 FriBiDi with x86_64 Python) and it just ignores that, so I'm not sure if the crash is in Pillow or just in FriBiDi. @euronautic do you have a
I'm guessing the last one (one of the PATH directories) is the culprit, if so what is this directory? |
#6341 has been merged, so in the next release of Pillow (due on July 1), the ImageDraw import problem should be fixed, leaving just the ImageFont import problem. @euronautic are you able to provide an answer to the last comment? |
This clearly isn't happening in our CI environments, nor for the vast majority of Windows users. You haven't mentioned anything unusual about your setup, so without further responses, we aren't able to effectively debug this problem. |
In #6374 a similar issue was caused by the file @euronautic do you also have this file on your system? |
Closing this issue as no feedback has been received. |
What did you do?
from PIL import ImageDraw
Run in File and in Interactive Mode
What did you expect to happen?
Import of ImageDraw and not crashing
What actually happened?
Python exits without any error while trying to import. Script or Interactive Mode is closed.
What are your OS, Python and Pillow versions?
Script:
Output:
Crash without any error
The text was updated successfully, but these errors were encountered: