This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_ttk_guionly fails on OS X using ActiveState Tcl 8.5.9 (Cocoa)
Type: behavior Stage: resolved
Components: macOS, Tests, Tkinter Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ned.deily Nosy List: georg.brandl, ned.deily, python-dev, ronaldoussoren
Priority: high Keywords:

Created on 2010-12-19 13:29 by ned.deily, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue10736.txt ronaldoussoren, 2011-03-15 23:19 review
Messages (12)
msg124346 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-12-19 13:29
3.2b2(~)

The following two test failures are seen with the newly released Cocoa-based ActiveState Tcl 8.5.9 on OS X 10.6.  No failures are reported when using the Apple Tcl/Tk 8.5 supplied with 10.6.

======================================================================
ERROR: test_tab_identifiers (tkinter.test.test_ttk.test_widgets.NotebookTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/tkinter/test/test_ttk/test_widgets.py", line 564, in test_tab_identifiers
    self.assertEqual(self.nb.tab('@5,5'), self.nb.tab('current'))
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/tkinter/ttk.py", line 922, in tab
    return _val_or_dict(kw, self.tk.call, self._w, "tab", tab_id)
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/tkinter/ttk.py", line 318, in _val_or_dict
    res = func(*(args + options))
_tkinter.TclError: tab '@5,5' not found

======================================================================
FAIL: test_traversal (tkinter.test.test_ttk.test_widgets.NotebookTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/tkinter/test/test_ttk/test_widgets.py", line 726, in test_traversal
    self.assertEqual(self.nb.select(), str(self.child1))
AssertionError: '.4654766160' != '.4654766352'
- .4654766160
?         ^^^
+ .4654766352
?         ^^^

Also multiple instances of the following apparently harmless message appear when using the ActiveState 8.5.9 Tcl:

setCanCycle: is deprecated.  Please use setCollectionBehavior instead

This is likely due to an upstream build problem from ActiveState.

http://permalink.gmane.org/gmane.comp.lang.tcl.mac/6524
msg124348 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-19 13:34
Are you in a position to debug this a bit more?
msg124350 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-12-19 13:40
I'll look into it.  No need to hold up beta2 for this.
msg127871 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-02-04 07:38
After looking into these two test failures a bit more, it looks like both are due to regressions and/or bugs in the ActiveState Tk 8.5.9 Cocoa behavior versus the Apple Cocoa Tk 8.5.7, with which neither test fails.

The test_tab_identifiers failure may be a test case error where the test is making unwarranted assumptions about how the Notebook widget lays out its tabs.

The test_traversal failure may need to be modified to use a different key modifier for OS X (<alt> -> <option>) but there appears to be a deeper problem within Cocoa Tk on how the traversal is implemented (hint, option-char can run into the dead key problem documented in Issue10973).

http://docs.python.org/py3k/library/tkinter.ttk.html#tkinter.ttk.Notebook.enable_traversal

Neither of these failures appear to indicate any problems with tkinter itself.  At this stage in the 3.2 cycle, the failures can either be ignored or, if necessary, conditionally disabled for platform 'darwin'. This should be a release manager call.  Otherwise, the next step would be to isolate further and report as possible upstream bugs.

Also, the "setCanCycle: is deprecated" warnings have subsequently been shown to be avoidable by a change in the upstream Tcl/Tk build process and are expected to disappear in the next release of ActiveState Tcl/Tk 8.5.
msg127905 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-02-04 16:34
I would prefer just letting the tests fail.  Disabled tests are usually forgotten, and never re-enabled.
msg131065 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-03-15 23:19
The attached patch fixes the test failures with Tk 8.5.9, I haven't tested with other versions or other platforms.

The change to 'test_traversal' should be sane.

The change to 'test_tab_identifiers' is more phishy. I've done two changes there: (1) slightly different index to test for tab 0, as layout on OSX needs more space and (2) the code assumes that tab("idx") won't raise an exception, I've added a TclError catch to ensure that other locations get tested as well.

With these changes the tests pass, but I'd like a review from someone that knows about tkinter and ttk before committing.
msg137223 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-29 22:29
New changeset de4d34a95603 by Ned Deily in branch 'default':
Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
http://hg.python.org/cpython/rev/de4d34a95603
msg137224 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-29 22:40
New changeset c2f61149764e by Ned Deily in branch 'default':
Issue #10736: Revert changeset de4d34a95603 as it causes failures with
http://hg.python.org/cpython/rev/c2f61149764e
msg137225 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-05-29 22:46
The changes looked good to me and fixed the test failures with Cocoa Tk 8.5.9 and caused no regressions with the ActiveState Carbon Tk 8.4 so I committed them to get some exposure.  But then I recalled I had not tested with just the old Apple-supplied Tk 8.4 and, of course, the test fails there.  So reverting for now.
msg137227 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-05-29 23:16
It appears the original (unmodified) test also fails with the old Apple-supplied Tk 8.4 (this is on OS X 10.5).  So I'll do some more testing and then probably re-apply this at some point after the current round of releases.
msg139344 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-28 06:20
New changeset 4a0b929b5c3d by Ned Deily in branch '2.7':
Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
http://hg.python.org/cpython/rev/4a0b929b5c3d

New changeset 570cdef34066 by Ned Deily in branch '3.2':
Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
http://hg.python.org/cpython/rev/570cdef34066

New changeset b7c61000ceec by Ned Deily in branch 'default':
Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
http://hg.python.org/cpython/rev/b7c61000ceec
msg139383 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-06-29 00:08
No obvious buildbot problems so far so I'm going to close this as fixed.  Thanks for the patch, Ronald.
History
Date User Action Args
2022-04-11 14:57:10adminsetgithub: 54945
2011-06-29 00:08:38ned.deilysetstatus: pending -> closed

messages: + msg139383
2011-06-28 06:21:57ned.deilysetstatus: open -> pending
resolution: fixed
stage: resolved
2011-06-28 06:20:41python-devsetmessages: + msg139344
2011-05-29 23:16:18ned.deilysetmessages: + msg137227
2011-05-29 22:46:43ned.deilysetmessages: + msg137225
2011-05-29 22:40:50python-devsetmessages: + msg137224
2011-05-29 22:29:42python-devsetnosy: + python-dev
messages: + msg137223
2011-03-15 23:19:08ronaldoussorensetfiles: + issue10736.txt

messages: + msg131065
2011-02-21 11:04:57ned.deilysetpriority: critical -> high
versions: + Python 2.7, Python 3.3
2011-02-04 16:34:29georg.brandlsetmessages: + msg127905
2011-02-04 07:38:37ned.deilysetmessages: + msg127871
2011-01-15 16:40:16georg.brandlsetpriority: deferred blocker -> critical
2010-12-19 13:40:36ned.deilysetmessages: + msg124350
2010-12-19 13:34:59georg.brandlsetmessages: + msg124348
2010-12-19 13:31:06ned.deilysetnosy: + georg.brandl
2010-12-19 13:29:53ned.deilycreate