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='')

Edited by pyTony: fixed formatting

5 Years
Discussion Span
Last Post by vegaseat

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
is the highest version listed

Edited by ZZucker


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.

Edited by vegaseat

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.