473,465 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2913
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.