Fix the way it reads the file name

#2
by lhoestq HF staff - opened

On unix, you can indeed split the '/' to get the filename as the last item in the list.
On Windows, the separator may be a '\' so this doesn't work.
In streaming mode, URLs may look like 'zip://data/file.txt::https://foo.bar.data.zip' so this doesn't work either.

I fixed it by using os.path.basename, which works on Unix and Windows, and which datasets extends to also work with chained URLs.

Roger that! Thanks for the explanation!

alkzar90 changed pull request status to merged

Sign up or log in to comment