[ python-Bugs-1233799 ] tkFileDialog.askopen... fails when dir=""

SourceForge.net noreply at sourceforge.net
Thu Jul 7 00:08:18 CEST 2005


Bugs item #1233799, was opened at 2005-07-06 15:08
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1233799&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Russell Owen (reowen)
Assigned to: Martin v. Löwis (loewis)
Summary: tkFileDialog.askopen... fails when dir=""

Initial Comment:
The following simple code fails on MacOS X 10.3 running the built-
in python 2.3 and Aqua Tcl/Tk 8.4.9:

import Tkinter
import tkFileDialog

root = Tkinter.Tk()
newPath = tkFileDialog.askopenfilename(
	initialdir = "",
)

The error is:
Traceback (most recent call last):
  File "tkFileDialog_askopen bug.py", line 5, in ?
    newPath = tkFileDialog.askopenfilename(
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/
lib/python2.3/lib-tk/tkFileDialog.py", line 119, in askopenfilename
    return Open(**options).show()
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/
lib/python2.3/lib-tk/tkCommonDialog.py", line 52, in show
    s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: bad directory ""

The same code runs fine on unix Python 2.2.3 with unknown tcl/tk 
and on and unix Python 2.4.1 with tcl/tk 8.4.9. it starts out in the 
user's home directory as I'd expect.

Mind you, I know I can use None or not specify the initialdir 
argument. But in my code it's a string that *might* be empty.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1233799&group_id=5470


More information about the Python-bugs-list mailing list