You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/serhiy-storchaka'closed_at=<Date2016-10-25.07:32:19.547>created_at=<Date2015-10-22.23:19:06.068>labels= ['type-bug', 'expert-tkinter']
title='Tix HList header_exists should be "exist"'updated_at=<Date2017-03-31.22:54:41.638>user='https://bugs.python.org/rtw'
File "...\python3\lib\tkinter\tix.py", line 926, in header_exists
return self.tk.call(self._w, 'header', 'exists', col)
_tkinter.TclError: unknown option "exists". Must be cget, configure, create, delete, exist or size
IOW the option should be "exist" not "exists".
I've seen this on Windows with python 2.7 and 3.4 and Linux-Mint with 2.7.6.
The current method "header_exists" doesn't seem to be referenced or documented anywhere.
(Rob: FYI, a crash is something worse than just an exception.)
I know very little about tix, so I don't know whether the bug is really passing 'exists' or that not being accepted. I think it is the latter. The offending function in class HList is
suggests that header_exists is written correctly and that 'exists' is not the error. The other accepted options, cget, configure, create, delete, and size are other options for y when x is 'header'.
I don't know what an 'entry' must be, but this runs without error.
>>> root = tix.Tk()
>>> hl = tix.HList(root)
>>> hl.info_exists('')
'0'
Still, it is possible that the attached patch is the best we can do, but then, if I am correct, a comment should be added that it is a bug workaround.
A test is really needed, but test_tix, added in 3.5, is vestigial and only tests that tix.Tk() works on Windows. Adding real tests would be a separate issue. Serhiy, is this something that might be done or is tix considered passe'?
It looks as a bug in Tix. All other Tcl, Tk and Tix commands (except "assemblecode") use "exists", and "header exists" is documented. Perhaps we should workaround this bug. But I doubt about renaming header_exists to header_exist.
As for tests, I'm working on writing tests for Tix. The progress is slow because Tix provides a lot of classes with a lot of commands and options, but I hope to finish the work before releasing 3.6. We can commit the patch for this issue without tests, just add a reminder in test_tix.py.
I agree. Leave the name 'header_exists', consistent with all others, pass 'exist', and add a comment. Optional: report the bug upstream if there are tix maintainers somewhere.
Serhiy, my question about the status of tix is really whether I can use it in IDLE, since it is not now.
Serhiy, my question about the status of tix is really whether I can use it in IDLE, since it is not now.
I can't say anything. But be aware that Tix is optional and likely is not installed on Linux. Maintainers should add new dependence to IDLE package in every distribution.
Subsequent to me suggesting a test, the 3.6 doc gained this: "Deprecated since version 3.6: This Tk extension is unmaintained and should not be used in new code." This answers my question about using it in IDLE. Good to apply this anyway, but no test is fine with me.
Activity
rtw commentedon Oct 22, 2015
The method header_exists of Tix HList raises:
File "...\python3\lib\tkinter\tix.py", line 926, in header_exists
return self.tk.call(self._w, 'header', 'exists', col)
_tkinter.TclError: unknown option "exists". Must be cget, configure, create, delete, exist or size
IOW the option should be "exist" not "exists".
I've seen this on Windows with python 2.7 and 3.4 and Linux-Mint with 2.7.6.
The current method "header_exists" doesn't seem to be referenced or documented anywhere.
terryjreedy commentedon Oct 23, 2015
(Rob: FYI, a crash is something worse than just an exception.)
I know very little about tix, so I don't know whether the bug is really passing 'exists' or that not being accepted. I think it is the latter. The offending function in class HList is
There are also
This pattern, and the more general pattern
suggests that header_exists is written correctly and that 'exists' is not the error. The other accepted options, cget, configure, create, delete, and size are other options for y when x is 'header'.
http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixHList.htm#M73
also suggests that 'exists is correct, since the tcl for this is "pathName header exists col", with 'exists', not 'exist'.
Still, it is possible that the attached patch is the best we can do, but then, if I am correct, a comment should be added that it is a bug workaround.
A test is really needed, but test_tix, added in 3.5, is vestigial and only tests that tix.Tk() works on Windows. Adding real tests would be a separate issue. Serhiy, is this something that might be done or is tix considered passe'?
serhiy-storchaka commentedon Nov 1, 2015
It looks as a bug in Tix. All other Tcl, Tk and Tix commands (except "assemblecode") use "exists", and "header exists" is documented. Perhaps we should workaround this bug. But I doubt about renaming header_exists to header_exist.
As for tests, I'm working on writing tests for Tix. The progress is slow because Tix provides a lot of classes with a lot of commands and options, but I hope to finish the work before releasing 3.6. We can commit the patch for this issue without tests, just add a reminder in test_tix.py.
terryjreedy commentedon Nov 1, 2015
I agree. Leave the name 'header_exists', consistent with all others, pass 'exist', and add a comment. Optional: report the bug upstream if there are tix maintainers somewhere.
Serhiy, my question about the status of tix is really whether I can use it in IDLE, since it is not now.
serhiy-storchaka commentedon Nov 1, 2015
I can't say anything. But be aware that Tix is optional and likely is not installed on Linux. Maintainers should add new dependence to IDLE package in every distribution.
terryjreedy commentedon Nov 2, 2015
If tkinter and IDLE are some places installed without tix, then it it not usable.
What about the suggestion for a revised patch?
serhiy-storchaka commentedon Dec 19, 2015
Opened Tix bug: https://sourceforge.net/p/tix/bugs/110/ .
serhiy-storchaka commentedon Dec 19, 2015
As for using Tix in IDLE, on Python wiki [1] there is a mention about the 'Tixed' version of IDLE called IDEStudio: [2], [3].
[1] https://wiki.python.org/moin/Tix
[2] http://web.archive.org/web/20050307041957/starship.python.net/crew/mike/Idle/
[3] http://www.sourcefiles.org/Programming/Development/Environments/idestudio-1.9-linux-x86-350.tar.gz
python-dev commentedon Oct 24, 2016
New changeset f57078cf5f13 by Serhiy Storchaka in branch '2.7':
Issue bpo-25464: Fixed HList.header_exists() in Tix module by adding
https://hg.python.org/cpython/rev/f57078cf5f13
New changeset e928afbcc18a by Serhiy Storchaka in branch '3.5':
Issue bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin
https://hg.python.org/cpython/rev/e928afbcc18a
New changeset 523aecdb8d5f by Serhiy Storchaka in branch '3.6':
Issue bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin
https://hg.python.org/cpython/rev/523aecdb8d5f
New changeset 5b33829badcc by Serhiy Storchaka in branch 'default':
Issue bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin
https://hg.python.org/cpython/rev/5b33829badcc
serhiy-storchaka commentedon Oct 25, 2016
It is hard to add tests because testing infrastructure for Tix doesn't exist.
terryjreedy commentedon Oct 25, 2016
Subsequent to me suggesting a test, the 3.6 doc gained this: "Deprecated since version 3.6: This Tk extension is unmaintained and should not be used in new code." This answers my question about using it in IDLE. Good to apply this anyway, but no test is fine with me.