Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_sheet {IndexError}list index out of range // XLSX can't be opened #176

Closed
lbesnard opened this Issue Mar 12, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@lbesnard
Copy link

lbesnard commented Mar 12, 2019

Hi

I've found some issues trying to open some xlsx files:

pyexcel.get_sheet(file_name="BAD.xlsx")   

returns {IndexError}list index out of range

I then opened the BAD.xlsx with libreoffice and exported it as a xlsx 2009/2013 to GOOD.xlsx.
then running the same command was successful
pyexcel.get_sheet(file_name="GOOD.xlsx")

Files attached
GOOD.xlsx
BAD.xlsx

I'm running the latest versions of the pyexcel packages

Cheers!

@chfw

This comment has been minimized.

Copy link
Member

chfw commented Mar 12, 2019

Reproduced

@chfw chfw closed this in dda27b8 Mar 12, 2019

@chfw chfw referenced this issue Mar 12, 2019

Merged

release 0.5.13 #177

@chfw

This comment has been minimized.

Copy link
Member

chfw commented Mar 12, 2019

In next release, pyexcel.exceptions.NoDataRead exception will be raised, to indicate no data read. I thought passing empty data structure around is not effective as passing an exception.

@chfw

This comment has been minimized.

Copy link
Member

chfw commented Mar 12, 2019

I had a change in mind as people are not used to get an exception when '{}' is returned so giving:

{"": [[]]]} to a sheet
and
{} to a book.

@lbesnard

This comment has been minimized.

Copy link
Author

lbesnard commented Mar 12, 2019

@chfw thanks a lot for the help. I have installed the new release. However do you know what is wrong with this file ? I still cannot seem to parse it.
Cheers

@chfw

This comment has been minimized.

Copy link
Member

chfw commented Mar 12, 2019

I have a library which can handle it: pyexcel-xlsxr, which uses lxml to read it instead.

I tried it and it works.

in order to use it, you need to pass: get_sheet(.... library='pyexcel-xlsxr') after pip install pyexcel-xslxr.

or, you have into pip uninstall pyexcel-xlsx pyexcel-xls so that no xlsx reader will compete for pyexcel-xlsxr.

@chfw

This comment has been minimized.

Copy link
Member

chfw commented Mar 12, 2019

Oh...no.. there is loads of data inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.