Opening UNC style filenames with tkFileDialog...

Rod Stephenson viking_kiwi at yahoo.com
Tue Apr 30 18:57:24 EDT 2002


I've installed an application together with some data files on a
network server, but having problems with users on the network opening
the data files using askopenfile() from the tkFileDialog Tkinter
module. The application starts in the directory on the server, and
succesfully opens some hardcoded data files in the application directory.

However on trying to open a user selected file when running the app
from a machine on the network, I get the error message
...
File "tkFileDialog.pyc", line 108, in askopenfile
IOError: [Errno 2] No such file or directory: '//server/drrod/test1.dat'

It's odd since I can: 

--from a remote machine issue:
>>> open("//server/drrod/test1.dat")
at the python prompt and open the file OK.

--from the server, call up the file dialog and open the file either as
  a local filename, or through the network neighborhood on that machine.

--from the remote machine the Tcl script "open [tk_getOpenFile]" works
  perfectly happily as well. 

The application is compiled to a standalone .exe using py2exe; I may
resort to installing python on the server and seeing if this solves
the problem, though first I will probably first try sticking some
debugging code into tkFileDialog.py. But any other suggestions as to
what the problem might be would be appreciated.

-- 
Rod Stephenson



More information about the Python-list mailing list