edit_modified() bug in Tkinter?

George Trojan gtrojan at erols.com
Sat Mar 6 20:55:33 CET 2004

The call

print self.ed.edit_modified()

where self.ed is t.component('text'), and t is Pmw.ScrolledText(),
gives the following traceback:

Exception in Tkinter callback
Traceback (most recent call last):
   File "/usr/local/python/lib/python2.3/lib-tk/Tkinter.py", line 1346, 
in __call__
     return self.func(*args)
   File "ed.py", line 30, in redo
     print self.ed.edit_modified()
   File "/usr/local/python/lib/python2.3/lib-tk/Tkinter.py", line 2832, 
in edit_modified
     return self.edit("modified", arg)
   File "/usr/local/python/lib/python2.3/lib-tk/Tkinter.py", line 2820, 
in edit
     return self._getints(
   File "/usr/local/python/lib/python2.3/lib-tk/Tkinter.py", line 973, 
in _getints
     return tuple(map(getint, self.tk.splitlist(string)))
TypeError: coercing to Unicode: need string or buffer, bool found

Is the following fix in Tkinter.py, line 2831, a reasonable thing to do?

#       return self.edit("modified", arg)
         return self.tk.call((self._w, 'edit', 'modified') + (arg,))

I'd prefer not to modify Python distribution code.


More information about the Python-list mailing list