Hello. I tried to run tk app on trunk, I got following error.
///////////////////////////////////
// Code
import Tkinter as Tk
root = Tk.Tk()
label = Tk.Label(root, text="Test")
label.pack(fill=Tk.BOTH, expand=True)
root.mainloop()
///////////////////////////////////
// Error
Traceback (most recent call last):
File "\debug.py", line 6, in <module>
label = Tk.Label(root, text="Test")
File "e:\python-dev\trunk\lib\lib-tk\Tkinter.py", line 2464, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "e:\python-dev\trunk\lib\lib-tk\Tkinter.py", line 1930, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: invalid command name "label .12893496 -text Test"
This is due to the change revision 55504 (Stop using METH_OLDARGS)
Currently, lib/lib-tk/Tkinter.py uses this convension
1929: self.tk.call(
1930: (widgetName, self._w) + extra + self._options(cnf))
...passing argument as single tuple. METH_OLDARGS treats this as same as
self.tk.call(
widgetName, self._w, *(extra + self._options(cnf)))
So it was working, but now METH_VARARGS, it doesn't expand single tuple as arguments.
Maybe do we need to check all tk.call and apply patches like this?
Index: Lib/lib-tk/Tkinter.py
===================================================================
--- Lib/lib-tk/Tkinter.py (revision 55836)
+++ Lib/lib-tk/Tkinter.py (working copy)
@@ -1927,7 +1927,7 @@
classes.append((k, cnf[k]))
del cnf[k]
self.tk.call(
- (widgetName, self._w) + extra + self._options(cnf))
+ widgetName, self._w, *(extra + self._options(cnf)))
for k, v in classes:
k.configure(self, v)
def destroy(self):
# Maybe already someone working on this?
|