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.

Author pfhall
Recipients pfhall
Date 2010-11-04.20:56:04
SpamBayes Score 1.8945774e-06
Marked as misclassified No
Message-id <>
I am running the following :

Linux Centos version 2.6.18
Python version 2.5
tk version 8.5
tcl version 8.5

I have a Python GUI program (importing Tkinter and tkFileDialog)
which prompts the user to select a (one to many) list of file names. 
The code is :

fileList = tkFileDialog.askopenfilenames(initialdir=self.startfiledir,
                                         title="Select Files for Processing",
                                         filetypes=self.ftypes, multiple=1)

where "startfiledir" and "ftypes" are defined elsewhere.
When this code is run a file selection box pops up
listing the chosen directory. Selecting just one file works fine.

To select multiple files the user highlights a selection
of the displayed files by dragging the cursor over them 
with "SHIFT left-mouse-button" pressed. 
It also lists ALL the selected files in the "File names:" selection field
at the bottom of the selection box. These are separated by spaces.
Clicking "Open" results in the selection box program trying to treat
the entire list as a single file name.
IE. It looks for a single file called "/home/mydir/file1 file2 file3 file4".
Since there is no such file an error pop-up box appears with a 
"File ... does not exist." message.

It appears that the file name list is not being parsed into indivdual file names.
I have tried combinations with "askopenfilename" instead of "askopenfilenames"
and including/omitting "multiple=1". 
I have also tried "multiple=bool(1)" and "multiple=xxx"
where "xxx=1" and "xxx=bool(1)".
None of these change the behaviour.

Is there a fault with my code ?
Is this a bug in "tkFileDialog.askopenfilenames" ?
Is there a workaround ?

Suggestions are welcome.
Date User Action Args
2010-11-04 20:56:11pfhallsetrecipients: + pfhall
2010-11-04 20:56:11pfhallsetmessageid: <>
2010-11-04 20:56:05pfhalllinkissue10316 messages
2010-11-04 20:56:04pfhallcreate