Skip to content

gh-83653: Do not save a blank int entry in IDLE Settings#152743

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-83653-config-int-blank
Open

gh-83653: Do not save a blank int entry in IDLE Settings#152743
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-83653-config-int-blank

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 1, 2026

Copy link
Copy Markdown
Member

Integer entry fields in the Settings dialog use a StringVar with a default per-keystroke callback that writes the raw value to changes. Deleting all digits from a field (e.g. "Auto squeeze min lines") wrote an empty string to the config file, which then produced a Warning: config.py - IdleConf.GetOption - invalid 'int' value when the option was read back.

The default callback now skips empty values. These entries are digits_only-validated, so blank is the only invalid value they can produce. The check is value != '' rather than a truthiness test so that IntVar 0 and BooleanVar False are still saved. Legitimate empty values (such as the second theme/key-set name) go through named callbacks, not this one.

Spinoff of gh-79597 (bpo-31414). The added test covers a blanked entry being skipped and a valid entry being saved.

Credit to Cheryl Sabella (@csabella), who reported this bug with a reproducer and wrote the original VarTrace int-entry handling (bpo-30853) that this change completes.

🤖 Generated with Claude Code

@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 Jul 1, 2026
Blanking an integer entry wrote an empty string to the config file, which
caused an "invalid int value" warning when it was read back.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
@serhiy-storchaka serhiy-storchaka force-pushed the gh-83653-config-int-blank branch from a3879c2 to a3e8132 Compare July 1, 2026 06:59
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