[Python-bugs-list] [ python-Bugs-661357 ] tkFileDialog.SaveAs

noreply@sourceforge.net noreply@sourceforge.net
Fri, 03 Jan 2003 03:28:22 -0800


Bugs item #661357, was opened at 2003-01-02 23:33
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=661357&group_id=5470

Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Martin v. Löwis (loewis)
Summary: tkFileDialog.SaveAs

Initial Comment:
The SaveAs dialog gets a traceback due to the new
object-style Tk interface.  Run this test program:

from Tkinter import *
import tkFileDialog

def doit():
    savedialog = tkFileDialog.SaveAs(master=root)
    print savedialog.show(initialdir="/tmp",
initialfile="foo.py")

root = Tk()
button = Button(root, text="Save...", command=doit)
button.pack()
mainloop()

I get this traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python2.3/lib-tk/Tkinter.py",
line 1306, in __call__
    return apply(self.func, args)
  File "tkf.py", line 5, in doit
    print savedialog.show(initialdir="/tmp",
initialfile="foo.py")
  File
"/usr/local/lib/python2.3/lib-tk/tkCommonDialog.py",
line 54, in show
    s = self._fixresult(w, s)
  File
"/usr/local/lib/python2.3/lib-tk/tkFileDialog.py", line
58, in _fixresult
    path, file = os.path.split(result)
  File "/usr/local/lib/python2.3/posixpath.py", line
65, in split
    i = p.rfind('/') + 1
AttributeError: '_tkinter.Tcl_Obj' object has no
attribute 'rfind'


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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-01-03 12:28

Message:
Logged In: YES 
user_id=21627

Also, can you please try

x=root.tk.call(("tk_getSaveFile","-initialdir","/tmp","-initialfile","foo.py"))
print repr(x),str(x),x.typename

I always get plain strings as a result of that call.

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-01-03 11:56

Message:
Logged In: YES 
user_id=21627

I can't reproduce this. What system and Tcl version?

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

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