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
IDLE: make configdialog font page survive font failures #89266
Comments
There were reports on a previous issue that attempting to display some characters from some linux fonts in some distributions resulted in crashing Python. The crash reports mentioned XWindows errors about particular characters being too complex or something. I did not open an issue for this because it seemed beyond the ability of tkinter/IDLE to predict and handle. https://stackoverflow.com/questions/68996159/idle-settings-window-wont-appear reported that requesting the IDLE settings window resulting in IDLE hanging. The user used my print debug suggestion to determine that the problem was in configdialog.py at The user first thought the issue was with a chess font, and then determined that the problem font was the phaistos font from https://ctan.org/pkg/phaistos?lang=en. The font has the symbols from the Cretan Linear A script on the Disk of Phaistos. This issue is about
... To remove, "open Control Panel -> Fonts then locate and select Phaistos Regular font then proceed with clicking Delete button." I did not select 'test needed' because we cannot routinely install new fonts and I am not sure of how to do an automated test if we could. font.otf = OpenTypeFont, used on Windows, Linux, macOS.
https://fileinfo.com/extension/otf
It might be good test on other systems after Windows. |
FTR, the issue mentioned is bpo-42225. msg380227 still applies for me (with Tk 8.6.11), with segfaults when I try to preview the font. For some reason, however, the segfault appears to be when we're closing the options window: Python 3.9.6 (default, Jun 30 2021, 10:22:16)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faulthandler
>>> faulthandler.enable()
>>> import idlelib.idle
Fatal Python error: Segmentation fault Current thread 0x00007f0ca44c7740 (most recent call first): I do not experience any problems loading the IDLE preferences page. I will look into whether I can reproduce the problem described on Windows. |
Apologies, my previous message was not clear. When the segfault occurs is not consistent and sometimes occurs when previewing the font (as reported in the linked message) but more often when clicking the "ok" button (for which the faulthandler details are included). |
Thank you for finding what I could not. Your previous message, referenced above, reporting a problem that remains in 8.6.11 on linux, was ... "For me, this is not limited to special characters. Trying to load anything in Tk using the 'JoyPixels' font crashes (sometimes it does load but all characters are very random - most are whitespace - and it crashes again after a call to I believe this is what is being experienced on https://askubuntu.com/questions/1236488/x-error-of-failed-request-badlength-poly-request-too-large-or-internal-xlib-le because they are not using any special characters yet are reporting the same problem." JoyPixels is an emoji font. There are emoji in the BMP, but not in IDLE's initial font sample. Did you add some, or did problems occur without displaying any emoji? I presume that the Phaistos 'font' has glyphs for the unicode phaistos block in the first astral plane, U+101D0..101FD. If they include one of those characters in the font name displayed in the font list (ugh), then a problem is understandable, and the fix would be to filter astral chars (and possibly more) out of font names. But I won't assume this. Please try the experiments I outlined if you are so inclined. |
If nothing else, I should amend the doc note about font problems to include Windows if we verify the report. |
I was using an unmodified version of IDLE.
This is not the case. It is listed simply as "Phaistos", when calling
Report verified. Behaviour is exactly as described, hanging when trying to load the "Configure IDLE" window. I will look into exactly which line is the problem soon. |
IDLE is hanging on Lib/idlelib/configdialog.py:94 ( |
It turns out the problem is a combination of the font and IDLE preview content. With the phaistos font installed, inserting the content of the "Devanagari, Tamil" or "East Asian" sections into a Tk text widget causes it to freeze. For example, the following will fail: pack [text .t] The reason for this still confuses me, since Tk would never default (I believe) to trying to use phaistos font (and therefore it's installation should not affect this). I will report it to the Tk team. |
https://core.tcl-lang.org/tk/tktview/0338867c742 IMO this should be closed as third-party, since there is very little we can / should do (yes we could remove the offending characters from the preview if the user has the font installed, but this is a lot of extra code for a very rare issue). |
A similar report, https://stackoverflow.com/questions/69466716/python-3-10-idle-does-not-respond-everytime-i-hit-configure-idle-from-options |
I am unable to reproduce on either Python 3.9.6 (Tk 8.6.9) or 3.10.0 (Tk 8.6.10). |
Thanks. Did the FiraCode font work for you or merely not work without crashing? |
It worked fine (other than a few missing features such as context-aware punctuation). The steps I did to test were:
|
Bizarre. The SO OP just reported that deleting FiraCode fixed *his* 3.10 problem. There must be some unobvious difference in systems. |
This has been (supposedly) fixed in tcl/tk 8.6.12, included with all our Windows installers starting with 3.9.9. Thank you for investigating reporting to tcl/tk. Bugfix list at |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: