Has anyone installed tkinter 8.6 on windows ?
There is a known bug in filedialog.askopenfilenames which properly returns a tuple of file pathnames under linux, but returns a string under windows.
Typical windows return string (should be tuple):

C:/testdir/AnotherFile.txt {C:/testdir/This is file with spaces.txt} {C:/testdir/z_last-file test.txt}

I'm curious if tkinter 8.6 fixes this problem. I think 8.6 is released but not part of the python package yet.

# python 3.3, tkinter 8.5

from tkinter import filedialog

file_list =  filedialog.askopenfilenames( title = 'Select Files')
       print( '<', file_list, '>', sep="")

    if (not isinstance( file_list, tuple )):
       sc = win_askopen_convert( file_list)

    for x in sc:
       print( '[', x , ']', sep='')

Recommended Answers

All 3 Replies

I though it was odd, but that 'bug' has been in there ever since Python26.

I am unhappy to report that Python 3.3.1 still comes with the Tkinter Filedialog bug.
Could be a bug introduced by the Windows OS?
Looking in
C:\Python33\tcl\tk8.5
is the highest version listed

My semi-educated guess is that the error is caused by Window's insistance to use '\n\r' for a newline rather than the more common '\n'.

PyQT/PySide QFileDialog.getOpenFileNames() behaves better.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.