classification
Title: IDLE: Entry tests should delete before insert.
Type: behavior Stage: patch review
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: terry.reedy
Priority: normal Keywords: patch

Created on 2017-09-11 03:17 by terry.reedy, last changed 2017-09-11 20:34 by terry.reedy.

Pull Requests
URL Status Linked Edit
PR 3501 merged terry.reedy, 2017-09-11 19:44
PR 3502 merged python-dev, 2017-09-11 20:02
Messages (3)
msg301851 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 03:17
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.
msg301896 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 20:02
New changeset 667522efa8fedfb57fd89d7335d7dfd270f274d5 by Terry Jan Reedy in branch 'master':
bpo-31414: IDLE -- fix tk entry box tests by deleting first. (#3501)
https://github.com/python/cpython/commit/667522efa8fedfb57fd89d7335d7dfd270f274d5
msg301898 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-11 20:34
New changeset 31b242459cef0835057f08c8756559b3261aa8ff 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) (#3502)
https://github.com/python/cpython/commit/31b242459cef0835057f08c8756559b3261aa8ff
History
Date User Action Args
2017-09-11 20:34:13terry.reedysetmessages: + msg301898
2017-09-11 20:02:51python-devsetpull_requests: + pull_request3495
2017-09-11 20:02:35terry.reedysetmessages: + msg301896
2017-09-11 19:44:31terry.reedysetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request3494
2017-09-11 17:13:25Henk-Jaap Wagenaarsetnosy: - Henk-Jaap Wagenaar
2017-09-11 17:13:16Henk-Jaap Wagenaarsetnosy: + Henk-Jaap Wagenaar
2017-09-11 03:18:10terry.reedylinkissue30780 dependencies
2017-09-11 03:17:33terry.reedycreate