Skip to content

Tkinter: test failure due to Tk 8.6.14 listbox bugfix #107262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chrstphrchvz opened this issue Jul 25, 2023 · 3 comments
Closed

Tkinter: test failure due to Tk 8.6.14 listbox bugfix #107262

chrstphrchvz opened this issue Jul 25, 2023 · 3 comments
Assignees
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@chrstphrchvz
Copy link
Contributor

chrstphrchvz commented Jul 25, 2023

The current output of the itemconfigure command for listbox widgets falsely suggests that the configuration of listbox items is influenced by the options database (if I understand correctly). This will be fixed in Tk 8.6.14: see https://core.tcl-lang.org/tk/info/ed8eae599d76 and https://core.tcl-lang.org/tk/vdiff?from=edf00be1&to=025022a4

Although tkinter.Listbox.itemconfigure() will still work properly, test.test_tkinter.test_widgets.ListboxTest.test_itemconfigure will fail since it expects the erroneous output:

======================================================================
FAIL: test_itemconfigure (test.test_tkinter.test_widgets.ListboxTest.test_itemconfigure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_widgets.py", line 1002, in test_itemconfigure
    self.assertEqual(widget.itemconfigure(0, 'background'),
AssertionError: Tuples differ: ('background', '', '', '', 'red') != ('background', 'background', 'Background', '', 'red')

First differing element 1:
''
'background'

- ('background', '', '', '', 'red')
+ ('background', 'background', 'Background', '', 'red')

Linked PRs

@chrstphrchvz chrstphrchvz added the type-bug An unexpected behavior, bug, or error label Jul 25, 2023
@terryjreedy
Copy link
Member

I have no experience with the options database. Are we currently testing for buggy behavior?

@serhiy-storchaka
Copy link
Member

We are currently testing for the current behavior. They change Tk tests, so we should also change corresponding Tkinter tests. Either make them more lenient, so they will pass on all version (we can use mock.ANY for this), or expect different result depending on the Tk patch level, or only test this assertion on the fixed Tk with the correct result. The exact value is not so important as its "form" -- we test that itemconfigure() can take two arguments and return a 5-tuple, its first item is the option name and its last item is the current value.

Do you want to create a PR @chrstphrchvz?

serhiy-storchaka added a commit that referenced this issue May 30, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2024
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2024
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this issue May 30, 2024
…H-119806)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this issue May 30, 2024
…H-119807)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
hugovk pushed a commit to hugovk/cpython that referenced this issue Feb 18, 2025
hugovk pushed a commit to hugovk/cpython that referenced this issue Feb 18, 2025
@hugovk
Copy link
Member

hugovk commented Feb 18, 2025

We need to backport this to 3.9, because it's still using ubuntu-20.04 which is deprecated and will be fully unsupported in April: actions/runner-images#11101.

And the upgrade to newer Ubuntu also upgrades Tk.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 18, 2025
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 18, 2025
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 18, 2025
)

(cherry picked from commit 9732ed5)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
hugovk pushed a commit that referenced this issue Feb 19, 2025
hugovk added a commit that referenced this issue Feb 19, 2025
…130274)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk added a commit that referenced this issue Feb 19, 2025
…130275)

Co-authored-by: James De Bias <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants