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: Entry tests should delete before insert. #75595
Test_configdialog 'tests' several integer entry widgets by inserting a digit and then checking that the new value was sent to changes. However, users may delete an entry totally and enter a new value. If we associate an IntVar with the entry widget, int('') is called somewhere in the process, which raises. (IntVar(root).set('') does not, so the error is somewhere further along. The test should imitate users by delete and insert.
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.
New changeset 31b2424 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31414: IDLE -- fix tk entry box tests by deleting first. (GH-3501) (bpo-3502) 31b2424
Activity
terryjreedy commentedon Sep 11, 2017
Test_configdialog 'tests' several integer entry widgets by inserting a digit and then checking that the new value was sent to changes. However, users may delete an entry totally and enter a new value. If we associate an IntVar with the entry widget, int('') is called somewhere in the process, which raises. (IntVar(root).set('') does not, so the error is somewhere further along. The test should imitate users by delete and insert.
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.
terryjreedy commentedon Sep 11, 2017
New changeset 667522e by Terry Jan Reedy in branch 'master':
bpo-31414: IDLE -- fix tk entry box tests by deleting first. (bpo-3501)
667522e
terryjreedy commentedon Sep 11, 2017
New changeset 31b2424 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31414: IDLE -- fix tk entry box tests by deleting first. (GH-3501) (bpo-3502)
31b2424
terryjreedy commentedon Jan 27, 2020
Opened bpo-39472 for changes dialog itself.
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…