472,952 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

Possible bug in Tkinter for Python 2.6

Hello all,

I'm trying out Python 2.6 and I found what might be a bug in the Tkinter
module. How can I report it?

The possible bug is a traceback when trying to delete a menu item in a
menu where no items have associated commands.

For example:
------------------------------
from Tkinter import *

root = Tk()

mb = Menu(root)
root.configure(menu=mb)

fm = Menu(mb)
mb.add_cascade(label='File', menu=fm)

fm.add_command(label='Open')
fm.add_command(label='Quit')

def remove_menu_item():
fm.delete(1)

Button(root, text='Remove menu item',
command=remove_menu_item).pack(padx=12, pady=24)

root.mainloop()
------------------------------

Clicking on the button should remove the 'Open' item in the 'File' menu,
but ends up in a traceback:
File "/opt/Python2.6+Tk8.5/bin/Linux/lib/python2.6/lib-tk/Tkinter.py",
line 1410, in __call__
return self.func(*args)
File "menu.py", line 15, in remove_menu_item
fm.delete(1)
File "/opt/Python2.6+Tk8.5/bin/Linux/lib/python2.6/lib-tk/Tkinter.py",
line 2670, in delete
if c in self._tclCommands:

It just seems the _tclCommands attribute on menus is initialized to None
and never changed if none of the items actually have a command.

Thanks!
--
python -c "print ''.join([chr(154 - ord(c)) for c in
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"
Nov 19 '08 #1
3 2888
On Wed, 19 Nov 2008 10:57:53 +0100
"Eric Brunel" <se***********@no.spamwrote:
I'm trying out Python 2.6 and I found what might be a bug in the
Tkinter module. How can I report it?
maybe here:
http://bugs.python.org/issue3774
The possible bug is a traceback when trying to delete a menu item in
a menu where no items have associated commands.
[...]
It just seems the _tclCommands attribute on menus is initialized to
None and never changed if none of the items actually have a command
I ran into the same issue after I downloaded PysolFC-1.1 . I actually
uploaded a patch for PysolFC for it for Python26 on Ubuntu and forgot
all about it, thinking it could be some API change. Thanks for nailing
down the problem a bit more and asking the questions here. It helped me
to discover the bug reporting facility. According to the link above
this bug is already reported and fixed, but it's nice to know anyway.

Now for some really strange bug that still breaks PysolFC-1.1 on windows
for me with Python26 ... (Python25 not affected):

.....

File "c:\python26\lib\lib-tk\Tkinter.py", line 1202, in configure
return self._configure('configure', cnf, kw)
File "c:\python26\lib\lib-tk\Tkinter.py", line 1193, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: image "pyimage237" doesn't exist

I suspect there has been some upgrade or new compilation of tcl
that causes this behavior.

A.
Nov 19 '08 #2
Anton Vredegoor wrote:
On Wed, 19 Nov 2008 10:57:53 +0100
"Eric Brunel" <se***********@no.spamwrote:
>I'm trying out Python 2.6 and I found what might be a bug in the
Tkinter module. How can I report it?

maybe here:
http://bugs.python.org/issue3774
The fix will be in 2.6.1, which might be in December.

Nov 19 '08 #3
On Wed, 19 Nov 2008 18:51:03 +0100, Terry Reedy <tj*****@udel.eduwrote:
Anton Vredegoor wrote:
>On Wed, 19 Nov 2008 10:57:53 +0100
"Eric Brunel" <se***********@no.spamwrote:
>>I'm trying out Python 2.6 and I found what might be a bug in the
Tkinter module. How can I report it?
maybe here:
http://bugs.python.org/issue3774

The fix will be in 2.6.1, which might be in December.
Thanks! Quite easy to fix anyway, but I prefer having an official version.
--
python -c "print ''.join([chr(154 - ord(c)) for c in
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"
Nov 20 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: srijit | last post by:
Hello, Any idea - why the following code crashes on my Win 98 machine with Python 2.3? Everytime I run this code, I have to reboot my machine. I also have Win32all-157 installed. from Tkinter...
3
by: Rob Andrews | last post by:
I'm on a Red Hat 9 system, which has Python 2.2.2 installed, and I installed 2.3 separately into /home/rob/Python-2.3/ (creating the symbolic link "py23" to point to my 2.3 installation). Now I'm...
2
by: Stewart Midwinter | last post by:
this has me puzzled; I've created a small test app to show the problem I'm having. I want to use subprocess to execute system commands from inside a Tkinter app running under Cygwin. When I...
1
by: John Chambers | last post by:
Sp my latest adventure is attempting to use python's Tkinter module on a few machines. On my PB (OSX 10.3.9), I got the following confusing results: /Users/jc: python Python 2.3 (#1, Sep 13...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
5
by: Ben Kovitz | last post by:
Hi, I just tried to run Tkinter on OS X 10.3.9 under Python 2.4.3, and I'm getting a bus error as soon as I call Tk(). Googling has turned up info other Tkinter bus errors, but not this one that...
1
by: Joe Peterson | last post by:
I've been doing a lot of searching on the topic of one of Python's more disturbing issues (at least to me): the fact that if a __del__ finalizer is defined and a cyclic (circular) reference is...
13
by: Daniel Fetchinson | last post by:
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , Is it just me or others also think that it would be a major loss to remove tkinter from the python core? PEP 3108 starts off...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.