2.3 a1 True/False bug in tkinter?

Edward K. Ream edream at tds.net
Sat Jan 18 17:36:53 EST 2003


Hi,

I have tkinter code that works on 2.1 and 2.2 and fails on 2.3 a1 (on XP).

The code initializes tk checkboxes as follows:

for var in ivars:
  exec("self.%s_flag.set(c.%s_flag)" % (var,var))

This appears to work fine.  However, the following code later fails:

for var in ivars:
  exec("c.%s_flag = self.%s_flag.get()" % (var,var))

with the following traceback:

>>> Traceback (most recent call last):
File "c:\Apps\leo-3.9\leoFileCommands.py", line 1682, in write_LEO_file
c.setIvarsFromFind()
File "c:\Apps\leo-3.9\leoCommands.py", line 136, in setIvarsFromFind
find.set_ivars(c)
File "c:\Apps\leo-3.9\leoFind.py", line 254, in set_ivars
exec("c.%s_flag = self.%s_flag.get()" % (var,var))
File "<string>", line 1, in ?
File "c:\Apps\Python23\lib\lib-tk\Tkinter.py", line 239, in get
return getint(self._tk.globalgetvar(self._name))
ValueError: invalid literal for int(): False

Should this be considered a problem with Python or tkinter?  It seems like a
natural thing to do.

Edward
--------------------------------------------------------------------
Edward K. Ream   email:  edream at tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------






More information about the Python-list mailing list