Tkinter getint(), getboolean() argument must be str, not tuple
Bug report
Discovered during 3.13b1 release (we decided not to block the release over it, so this is just a known issue in b1):
While interacting with the config dialog in IDLE, I get these errors printed in the background.
Exception in Tkinter callback Traceback (most recent call last): File "D:\cpython\Lib\tkinter\__init__.py", line 2064, in __call__ args = self.subst(*args) File "D:\cpython\Lib\tkinter\__init__.py", line 1752, in _substitute e.state = getint_event(s) ~~~~~~~~~~~~^^^ File "D:\cpython\Lib\tkinter\__init__.py", line 1726, in getint_event return getint(s) TypeError: getint() argument must be str, not tuple
I suspect this is the underlying cause of these test failures, which were discovered in our final stage testing of the Windows release:
====================================================================== ERROR: test_highlight_target_text_mouse (idlelib.idle_test.test_configdialog.HighPageTest.test_highlight_target_text_mouse) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\b\Python\Lib\idlelib\idle_test\test_configdialog.py", line 447, in test_highlight_target_text_mouse eq(d.highlight_target.get(), elem[tag]) ~~~~^^^^^ KeyError: 'sel' ====================================================================== FAIL: test_highlight_sample_b1_motion (idlelib.idle_test.test_configdialog.HighPageTest.test_highlight_sample_b1_motion) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\b\Python\Lib\idlelib\idle_test\test_configdialog.py", line 493, in test_highlight_sample_b1_motion eq(hs.tag_ranges('sel'), ()) ~~^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Tuples differ: (<string object: '1.0'>, <string object: '1.24'>) != () First tuple contains 2 additional elements. First extra element 0: <string object: '1.0'> - (<string object: '1.0'>, <string object: '1.24'>) + () ====================================================================== FAIL: test_highlight_sample_double_click (idlelib.idle_test.test_configdialog.HighPageTest.test_highlight_sample_double_click) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\b\Python\Lib\idlelib\idle_test\test_configdialog.py", line 471, in test_highlight_sample_double_click eq(hs.tag_ranges('sel'), ()) ~~^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Tuples differ: (<string object: '1.0'>, <string object: '1.24'>) != () First tuple contains 2 additional elements. First extra element 0: <string object: '1.0'> - (<string object: '1.0'>, <string object: '1.24'>) + () ----------------------------------------------------------------------
Possibly related to @serhiy-storchaka's recent changes?
Linked PRs
- gh-118760: Fix errors in calling Tkinter bindings on Windows #118782
- gh-118760: Restore the default value of tkinter.wantobjects to 1 #118784
- [3.13] gh-118760: Fix errors in calling Tkinter bindings on Windows (GH-118782) #119072
- [3.13] gh-118760: Restore the default value of tkinter.wantobjects to 1 (GH-118784) #119251