-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
KeyError bug in readxl #31
Comments
I find it's a duplicate issue. I close it. |
hi there,
can you try to upgrade to v1.52 and see if that fixes your issue?
On Wed, Jan 27, 2021 at 7:53 AM Darcy ***@***.***> wrote:
*Pylightxl Version*:1.51
*Python Version*:3.8.3
*Office Version*: LibreOffice 7.0.4.2
*Summary of Bug/Feature*: KeyError Bug
*Traceback*:
File "......\pylightxl\pylightxl.py", line 135, in readxl
worksheet = ordered_ws[order]
KeyError: 1
*Suggestion for fix*:
def readxl(fn, ws=None):
... ...
# get all worksheets
for order in range(1, len(ordered_ws) + 1): ----> for order in ordered_ws.keys():
worksheet = ordered_ws[order]
... ...
I found ordered_ws is {2: 'sheet1', 3: 'sheet2', 4: 'sheet3'}
It seems like the start number is 2 instead of 1.
so I do that change, that worked for me.
I am using LibreOffice to edit this xlsx file. So maybe there is some bug
in LibreOffice.
Thanks :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#31>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIOU6F2YE3PHEAU47KW2UTDS4AZGDANCNFSM4WVPXKPA>
.
--
Best,
Viktor Kis
|
Thank you. v1.52 fixes my issue :> |
Pylightxl Version:1.51
Python Version:3.8.3
Office Version: LibreOffice 7.0.4.2
Summary of Bug/Feature: KeyError Bug
Traceback:
Suggestion for fix:
I found ordered_ws is {2: 'sheet1', 3: 'sheet2', 4: 'sheet3'}
It seems like the start number is 2 instead of 1.
so I do that change, that worked for me.
I am using LibreOffice to edit this xlsx file. So maybe there is some bug in LibreOffice ( or in pylightxl ).
Thanks :)
The text was updated successfully, but these errors were encountered: