We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c21d36f commit e65e939Copy full SHA for e65e939
pyexcel_io/io.py
@@ -190,7 +190,12 @@ def load_data(
190
reader = READERS.get_a_plugin(file_type, library)
191
except NoSupportingPluginFound:
192
if file_name:
193
- if not os.path.exists(file_name):
+ if os.path.exists(file_name):
194
+ if os.path.isfile(file_name):
195
+ raise
196
+ else:
197
+ raise IOError("%s is not a file" % file_name)
198
199
raise IOError("%s does not exist" % file_name)
200
else:
201
raise
tests/test_io.py
@@ -15,6 +15,11 @@
15
PY2 = sys.version_info[0] == 2
16
17
18
+@raises(IOError)
19
+def test_directory_name_as_file():
20
+ get_data('/')
21
+
22
23
def test_force_file_type():
24
test_file = "force_file_type.txt"
25
data = get_data(
0 commit comments