Repository navigation
New test_ttk failure on Mac: "bad screen distance" #124378
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Sep 23, 2024 - changed the title
[-]New test_ttk failure on Mac[/-][+]New test_ttk failure on Mac: "bad screen distance"[/+]on Sep 23, 2024 The patch only touches the test_ttk files (and a support.init gui check) while the error is in test_tkinter. On my mac Catalina, `python3.13 -n test -ugui test_tkinter' runs without error. test_ttk has 2 or 3 failures different from the above, 1 in tkinter.
@smontanaro Did you happen to just update to Tcl/Tk 8.6.15? I'm seeing the same failure on Windows in GH-124449. Unfortunately it does not seem to be addressed by @culler's GH-124156 (which is for gh-124111).
while the error is in test_tkinter.
It is actually a
test_ttk.test_widgetsfailure, in some test methods fromtest_tkinter.widget_tests.@zware Yes, 8.6.15 via Homebrew, updated Sep 20:
otool -L Modules/_tkinter.cpython-314t-darwin.so Modules/_tkinter.cpython-314t-darwin.so: /opt/homebrew/opt/tcl-tk/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.15) /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.15) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)I'm doing nothing to specify the Homebrew location. I see nothing which would be Apple-specific. Is that okay? I also a have slightly older version in my Python 3.12 Conda environment. I'll see if I can link to that.
Doesn't look like I can compile/link against the miniconda3 stuff:
% gcc -bundle -undefined dynamic_lookup Modules/_tkinter.o Modules/tkappinit.o -L/Users/skip/miniconda3/envs/python312/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6 -o Modules/_tkinter.cpython-314t-darwin.so ld: warning: object file (/Users/skip/src/python/cpython/Modules/_tkinter.o) was built for newer 'macOS' version (14.6) than being linked (14.0) ld: warning: object file (/Users/skip/src/python/cpython/Modules/tkappinit.o) was built for newer 'macOS' version (14.6) than being linked (14.0)The resulting
sofile fails to import:ERROR] _tkinter failed to import: dlopen(/Users/skip/src/python/cpython/build/lib.macosx-14.6-arm64-3.14/_tkinter.cpython-314t-darwin.so, 0x0002): Library not loaded: @rpath/libtk8.6.dylib Referenced from: <8EFFE0FA-0FD4-3E70-8AFD-11143C118A56> /Users/skip/src/python/cpython/Modules/_tkinter.cpython-314t-darwin.so Reason: no LC_RPATH's found Following modules built successfully but were removed because they could not be imported: _tkinterThat's good news, actually :). Something seems to have changed between 8.6.14 and 8.6.15 in ttk's Notebook, so we just need to adjust our tests.
- I was using the tip of core-8-6-branch, rather than the released 8.6.15, That could account for the difference.…On Tue, Sep 24, 2024 at 4:37 PM Zachary Ware ***@***.***> wrote: @zware <https://github.com/zware>, when you say that it is not addressed do you mean because GH-124156 <#124156> is for 3.14? (Because I do recall fixing that error.) I'm double checking, but I was still seeing the failure on Windows with 8.6.15 using your GH-124156 <#124156> branch merged into my GH-124449 <#124449> branch. — Reply to this email directly, view it on GitHub <#124378 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAJ6CP437Y4QEYJ3CMNF6RDZYHSRNAVCNFSM6AAAAABOW4D572VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZSGUYDOOJSG4> . You are receiving this because you were mentioned.Message ID: ***@***.***>
Ah ha. How likely is an 8.6.16 with that fix? :)
- I think it will be a year before we see 8.6.16. I will switch to the released 8.6.15 and update my PR so it works with that.…On Tue, Sep 24, 2024 at 4:50 PM Zachary Ware ***@***.***> wrote: Ah ha. How likely is an 8.6.16 with that fix? :) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***>
- Indeed, I can reproduce this test failure in GH-124156 with the tips of the core-8-6-16-rc branches (which were used for the release). I am now fixing it in the PR.…On Tue, Sep 24, 2024 at 5:10 PM Marc Culler ***@***.***> wrote: I think it will be a year before we see 8.6.16. I will switch to the released 8.6.15 and update my PR so it works with that. On Tue, Sep 24, 2024 at 4:50 PM Zachary Ware ***@***.***> wrote: > > Ah ha. How likely is an 8.6.16 with that fix? :) > > — > Reply to this email directly, view it on GitHub, or unsubscribe. > You are receiving this because you were mentioned.Message ID: ***@***.***>Reacted by Zachary Ware
I can explain the cause of this problem. There was a change to the Notebook widget after the release of 8.6.14 (the change was in February 2023) which made the Notebook's width and height become "pixel" options rather than integer options. A pixel option can accept values such as "10c" (i.e 10 centimeters). As far as the tkinter test suite is concerned, this means that checkPixelsParam should be used instead of checkIntegerParam. Making just that change in the test_configure_width and test_configure_height methods of the NotebookTest class makes these failures go away. In my PR I did exactly that, but only for 9.0, not for 8.6.
However, this "solution" has drawbacks. Namely, it does not test whether it actually works to set the width of a Notebook widget to "10c", because those two methods only test with integer values. Testing pixel options causes additional issues because, at the moment, the various widgets treat these options inconsistently. Setting an option to "10c" with configure and retrieving it with cget sometimes produces "10c" and sometimes produces the number of pixels, at the current screen resolution, which are needed to span a distance of 10 cm. The former behavior is correct (since screen resolutions can change any time) but not all widgets have yet been converted to have the correct behavior. That change is happening widget by widget at the moment.
30 remaining items
Bug report
Bug description:
I've been running with some patches from @ronaldoussoren to the following:
(See attached diff.)
test_ttk.txt
Everything was working fine, but today I began to get a repeatable failure in
test_ttk:I'm putting this out there with no further investigation. I doubt it will be a release blocker for 3.13, but if so, maybe the sprinters can find and fix the problem quickly.
CPython versions tested on:
3.12, 3.13, CPython main branch
Operating systems tested on:
macOS
Linked PRs