You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDLE: improve handling of int entry in settings dialog #83653
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:
assignee='https://github.com/terryjreedy'closed_at=Nonecreated_at=<Date2020-01-27.23:34:59.719>labels= ['expert-IDLE', 'type-bug', '3.9']
title='IDLE: improve handling of int entry in settings dialog'updated_at=<Date2020-01-28.12:32:21.133>user='https://github.com/terryjreedy'
Spinoff from gh-75595, about int entry fields. It claims: Note: a deeper problem is attaching a tracer that get called with each keystroke. Using a StringVar avoids the error when the entry is blanked, but currently allows non-ints to be saved. A better solution would be to not do the auto tracing, but use a IntVar and only call var_changed when the user 'leaves' the box, after checking for a count in a sane range.
With keeping it a StringVar, there is an issue where it writes a blank (ie, bad data) to the config file. Steps to reproduce:
Go into config dialog and click 'General' tab.
Delete value from 'Auto squeeze min line'
Click apply or OK. A warning message appears in the terminal
Warning: config.py - IdleConf.GetOption -
invalid 'int' value for configuration option 'auto-squeeze-min-lines'
from section 'PyShell': ''
Close out of IDLE.
Start IDLE again - the warning reappears, but on the General tab, it shows the original value.
The issue here is that the custom config-main.cfg is being written to (and then read back in) with the blank.
I picked the auto-squeezer because it has validation on it - validatecommand=self.digits_only.
Activity
terryjreedy commentedon Jan 27, 2020
Spinoff from gh-75595, about int entry fields. It claims: Note: a deeper problem is attaching a tracer that get called with each keystroke. Using a StringVar avoids the error when the entry is blanked, but currently allows non-ints to be saved. A better solution would be to not do the auto tracing, but use a IntVar and only call var_changed when the user 'leaves' the box, after checking for a count in a sane range.
Verify claim and proposed solution.
csabella commentedon Jan 28, 2020
With keeping it a StringVar, there is an issue where it writes a blank (ie, bad data) to the config file. Steps to reproduce:
Warning: config.py - IdleConf.GetOption -
invalid 'int' value for configuration option 'auto-squeeze-min-lines'
from section 'PyShell': ''
The issue here is that the custom config-main.cfg is being written to (and then read back in) with the blank.
I picked the auto-squeezer because it has validation on it -
validatecommand=self.digits_only.pythongh-83653: Do not save a blank int entry in IDLE Settings
gh-75595: Do not save a blank int entry in IDLE Settings (#152743)
[3.13] gh-75595: Do not save a blank int entry in IDLE Settings (GH-1…
[3.14] gh-75595: Do not save a blank int entry in IDLE Settings (GH-1…
[3.15] gh-75595: Do not save a blank int entry in IDLE Settings (GH-1…
terryjreedy commentedon Sep 27, 2026
Left open because I believe, without checking carefully, that PR is only a partial fix.