Skip to content

gh-90304: Fix IDLE startup failure with a broken font#152419

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:idle-set-width-zerodiv
Open

gh-90304: Fix IDLE startup failure with a broken font#152419
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:idle-set-width-zerodiv

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

On some systems a font reports a zero width for the '0' character (seen with a broken font on openSUSE). EditorWindow.set_width() divides the Text widget's pixel width by that value, so the ZeroDivisionError prevented IDLE from starting at all.

set_width() now falls back to the configured width when the measured width is zero. self.width is consumed by the === RESTART === separator in the shell and by the squeezer's line wrapping.

A font reporting a zero width for '0' made set_width() raise
ZeroDivisionError. It now falls back to the configured width.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant