pyexcel / pyexcel-io

One interface to read and write the data in various excel formats, import the data into and export the data from databases
http://io.pyexcel.org
Other
58 stars 20 forks source link

Pathnames with "." cause file_name error in get_writer. #115

Open markp2 opened 9 months ago

markp2 commented 9 months ago

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)

ShaheedHaque commented 7 months ago

Would having a PR help get this issue fixed/released?