-
-
Notifications
You must be signed in to change notification settings - Fork 164
Closed
Description
During keyword ingestion in:
Line 86 in d8b9650
def isave_as(**keywords): |
pyexcel assumes dest_file_name is a str, does not tolerate pathlib.Path
Here's an example:
>>> pyexcel.save_as(array=data, dest_file_name=path)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Data\venv\tablite310\lib\site-packages\pyexcel\core.py", line 82, in save_as
return sources.save_sheet(sheet, **dest_keywords)
File "C:\Data\venv\tablite310\lib\site-packages\pyexcel\internal\core.py", line 46, in save_sheet
a_source = SOURCE.get_writable_source(**keywords)
File "C:\Data\venv\tablite310\lib\site-packages\pyexcel\internal\source_plugin.py", line 91, in get_writable_source
return self.get_a_plugin(
File "C:\Data\venv\tablite310\lib\site-packages\pyexcel\internal\source_plugin.py", line 69, in get_a_plugin
source_cls = self.load_me_now(
File "C:\Data\venv\tablite310\lib\site-packages\pyexcel\internal\source_plugin.py", line 41, in load_me_now
if source.is_my_business(action, **keywords):
File "C:\Data\venv\tablite310\lib\site-packages\pyexcel\plugins\__init__.py", line 56, in is_my_business
raise IOError("Unsupported file type")
OSError: Unsupported file type
^--- This is not a useful error message for this input ---v
>>> path
WindowsPath('C:/Users/madsenbj/AppData/Local/Temp/junk_test/myfile.xlsx')
>>> pyexcel.save_as(array=data, dest_file_name=str(path))
>>>
If anything it should be TypeError(f"expected str, got {type(dest_file_name)}")
slingshotsys
Metadata
Metadata
Assignees
Labels
No labels