Issue 843999: tkFileDialog.Open is broken (original) (raw)

tkFileDialog.Open is broken, apparently due to the new object interface.

Try the following:

import Tkinter import tkFileDialog root = Tkinter.Tk() tkFileDialog.askopenfilename() Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/tkFileDialog.py", line 119, in askopenfilename return Open(**options).show() File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/tkCommonDialog.py", line 54, in show s = self._fixresult(w, s) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/tkFileDialog.py", line 89, in _fixresult if not widget.tk.wantobjects() and "multiple" in self.options: TypeError: wantobjects() takes exactly 1 argument (0 given)

Looking at the code, tkFileDialog.Open _fixresult is calling widget.tk.wantobjects() and apparently that function always wants an argument (though one would not necessarily think so from the function name, so the bug is not surprising).