Issue 1257772: tkapp read-only attributes (original) (raw)
same as bug: [ 1164742 ] Tkdnd.py crashes due to read-only attributes
Python 2.4.1 (#1, Mar 30 2005, 23:01:07) [GCC 3.3.5] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import Tkinter r=Tkinter.Tk()
r.a=1 del r.a Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1660, in delattr return delattr(self.tk, attr) TypeError: 'tkapp' object has only read-only attributes (del .a)
The problem vanishes commenting out the delattr methods in class Tk (module Tkinter.py):
class Tk(Misc, Wm): ... def delattr(self, attr): "Delegate attribute access to the interpreter object" return delattr(self.tk, attr)
I don't know if there is same subtle problem.