biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Error in File #4537

Closed Hrovatin closed 4 years ago

Hrovatin commented 4 years ago

When opening a tsv/tab file in Orange 3.25 with File widget I get the below error for certain files. This does not happen when using CSV File Import.

Error encountered in widget File:

Traceback (most recent call last):
File "/home/karin/Documents/git/orange3/Orange/widgets/data/owfile.py", line 310, in browse_file
filename, reader, _ = open_filename_dialog(start_file, None, readers)
File "/home/karin/Documents/git/orange-widget-base/orangewidget/utils/filedialogs.py", line 164, in open_filename_dialog
file_format = file_formats[filters.index(filter)]
ValueError: '' is not in list
Merge state
janezd commented 4 years ago

Can you attach one of such files? It looks very strange that this would be file-specific. It would seem that QFileDialog.getOpenFileName returns an empty string for a filter (that is, extension). The file does have an extension, right?

Which version of Linux and Qt?

Hrovatin commented 4 years ago

Yes, the files have extensions. colour.zip I do not remember having such issues on my computer at work, but I am currently on my laptop, so it might be specific to the system. Version of operating system: VERSION="18.04.4 LTS (Bionic Beaver)" Qt version (I am not sure which one is relevant): AnyQt==0.0.10 PyQt5==5.13.0 PyQt5-sip==4.19.18 pyqtgraph==0.10.0 PyQtWebEngine==5.13.0 qtconsole==4.5.5

robertcv commented 4 years ago

I cannot reproduce this. @Hrovatin are you always getting this issue with those files?

Hrovatin commented 4 years ago

Previously I was getting the error every time and also with some (but not all) other files. However, it seems to be working now. So I can no longer reproduce it.

janezd commented 4 years ago

I would still add a "blind fix" -- if filter is None and the extension is one of the known formats, we set it.

janezd commented 4 years ago

Moved to https://github.com/biolab/orange-widget-base/pull/53.