Skip to content
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

test_tkinter failing on MacOS #128846

Open
smontanaro opened this issue Jan 14, 2025 · 9 comments
Open

test_tkinter failing on MacOS #128846

smontanaro opened this issue Jan 14, 2025 · 9 comments
Labels
tests Tests in the Lib/test dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@smontanaro
Copy link
Contributor

smontanaro commented Jan 14, 2025

Bug report

Bug description:

test_tkinter is failing on MacOS (Sequoia 15.2, M1 MacBook Pro, in my case). It was working fine yesterday, so without delving into this too deeply, I'm going to suggest this change overnight broke things. See attached log

commit da8825ea95a7096bb4f933d33b212a94ade10f6e
Author: Zhikang Yan <[email protected]>
Date:   Mon Jan 13 23:54:46 2025 +0800

    gh-128562: Fix generation of the tkinter widget names (GH-128604)
    
    There were possible conflicts if the widget class name ends with a digit.

@Xiaokang2022

(FWIW, test_ttk is failing for me on 3.13, but not main. It appears to be a different problem.)

test_tkinter.log

CPython versions tested on:

CPython main branch, 3.13

Operating systems tested on:

macOS

Linked PRs

@smontanaro smontanaro added the type-bug An unexpected behavior, bug, or error label Jan 14, 2025
@zanieb zanieb added tests Tests in the Lib/test dir topic-tkinter labels Jan 14, 2025
@zanieb
Copy link
Contributor

zanieb commented Jan 14, 2025

The referenced commit is from #128604 / #128562

@zanieb
Copy link
Contributor

zanieb commented Jan 14, 2025

I can reproduce this on main / f7ceb31 but reverting da8825e does not resolve the failure.

@zanieb
Copy link
Contributor

zanieb commented Jan 14, 2025

I also reproduced this on an arbitrary older commit 2fcdc84 (and then b2ac70a)

If I go back to ce740d4, which I need to run the GUI tests on my machine, I get a bunch of failures — including what looks like the failures reported here. @smontanaro I don't know if it makes sense that these tests worked yesterday.

@zanieb
Copy link
Contributor

zanieb commented Jan 14, 2025

It looks like this is caused by using tk 9.0+, at least on my machine, Brew upgraded to a new version.

You can confirm with

❯ ./python.exe -c 'import tkinter; tcl = tkinter.Tcl(); print(tcl.call("info", "patchlevel"))'
9.0.1

In which case, this is part of

I don't think the tests are expected to pass with tk 9 yet.

@smontanaro
Copy link
Contributor Author

Hmmm... This might turn out to be pilot error. I have a config file in my personal build environment which gets Tcl/Tk libs from my Conda env:

TCLTK_CFLAGS=-I/Users/skip/miniconda3/envs/python312/include
TCLTK_LIBS='-L/Users/skip/miniconda3/envs/python312/lib -Wl,-rpath,/Users/skip/miniconda3/envs/python312/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6'

Somehow that was dropped from a command recalled from my bash history, so I was picking up 9.0.1. Now that I've corrected my commands, my build on main works and yields the expected version:

% ./python.exe -c 'import tkinter; tcl = tkinter.Tcl(); print(tcl.call("info", "patchlevel"))'
8.6.13

I've yet to pull in the correct command on my 3.13 Terminal window, so it still yields the later version:

% ./python.exe -c 'import tkinter; tcl = tkinter.Tcl(); print(tcl.call("info", "patchlevel"))'
9.0.1

Would it be worthwhile running this bit of code in the test suite, then skipping the tests if Tcl/Tk v9 was found?

@zanieb
Copy link
Contributor

zanieb commented Jan 14, 2025

That seems reasonable to me, but I'd be curious to hear from someone that's a stakeholder for that topic.

@sobolevn
Copy link
Member

cc @terryjreedy

@Xiaokang2022
Copy link
Contributor

This doesn't seem to be the cause of my commit, which passed macOS-related tests.

@terryjreedy
Copy link
Member

@serhiy-storchaka is the tkinter expert, not me. I would like to be able to use 9.0, but I don't know where that stands now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants