This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tkFileDialog.Open is broken
Type: Stage:
Components: Tkinter Versions: Python 2.3
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: loewis Nosy List: loewis, nnorwitz, reowen
Priority: normal Keywords:

Created on 2003-11-17 21:29 by reowen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg19017 - (view) Author: Russell Owen (reowen) Date: 2003-11-17 21:29
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 "<stdin>", 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).
msg19018 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-11-18 04:42
Logged In: YES 
user_id=33168

What version of Python are you using?  I just looked at the
code for 2.3.2 and tested it.  2.3.2 works fine.  Perhaps
this bug has already been fixed?
msg19019 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-12-01 21:08
Logged In: YES 
user_id=21627

This has been fixed in _tkinter.c 1.161, so you are probably
using some old version.
msg19020 - (view) Author: Russell Owen (reowen) Date: 2003-12-02 17:57
Logged In: YES 
user_id=431773

Sorry I forgot to say the version. I am using Python 2.3.0 (via the binary installer MacPython-OSX-2.3-1.dmg). I'm very glad to hear that this has already been fixed.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39561
2003-11-17 21:29:34reowencreate