pyexcel-io icon indicating copy to clipboard operation
pyexcel-io copied to clipboard

Pathnames with "." cause file_name error in get_writer.

Open markp2 opened this issue 1 year ago • 1 comments

The current version of get_writer:

https://github.com/pyexcel/pyexcel-io/blob/1caf894d0a3fda2e7392984690aead654c17464c/pyexcel_io/writers/csv_sheet.py#L50C22-L50C22

performs a split on the assumption there is just one dot "." in the pathname e.g. some_path .csv

However, in my application, I am passing in a path that includes a dot '"."

mark/.local/share/file.csv

Therefore I believe that the split on line 50 should; be right-split limited to 1 split:

names = self._native_book.split("."). -> names = self._native_book.rsplit(".", 1)

markp2 avatar Jan 13 '24 21:01 markp2