Repository navigation
Tkinter: Tk 8.7 alphabetizes options in certain error messages #104497
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortestsTests in the Lib/test dirTests in the Lib/test dir
on May 15, 2023 Easy fix would be to change
errmsg = ...toerrprefix = 'bad type "spam": must be 'and add[:25]to str(...). I am keeping equality check instead of using.startswithto for helpful error message.And if you want a little more, you can use
>>> from collections import Counter >>> Counter("1234") == Counter("3412") True
@sunmy2019 As near as I can tell from from searching _tkinter.c and tkinter/init.py, the actual error message is from tcl/tk. If so, all that needs testing is that as error is raised with 'spam' in the message. The options in the expected message come from the test itself, so a mismatch would indicate an error in tcl/tk, which we are not trying to test, or in the test, from being overy specific.
@chrstphrchvz The title and linked tcl issue suggest that multiple messages have been revised. If so, a special case fix for one test would be insufficient.
@chrstphrchvz The title and linked tcl issue suggest that multiple messages have been revised. If so, a special case fix for one test would be insufficient.
Understood, however this is currently the only test I have found to be affected by alphabetizing changes.
Then I made a PR to fix just that test.
As done by e.g. https://core.tcl-lang.org/tk/info/b7db31b3a38b and causing this Tkinter test to fail:
Linked PRs