Error when opening xlsx file
FYI when I try to open an xlsx file, I get the following error:
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
book = Workbook(path)
File "C:\Python27\lib\site-packages\xlsx\__init__.py", line 54, in __init__
self.domzip["xl/sharedStrings.xml"])
File "C:\Python27\lib\site-packages\xlsx\__init__.py", line 94, in __init__
self.__getIfInline(text))
File "C:\Python27\lib\site-packages\xlsx\__init__.py", line 101, in __getIfInline
for node in nodes])
AttributeError: 'NoneType' object has no attribute 'nodeValue'
I have verified that the file is in the specified path (the library throws an IOError if the path is wrong).
Check the file "xl/sharedStrings.xml" inside the docx file (it is a zip file of xml files). Possibly there is an empty
I am not activly maintaining this library, but if you submit a patch to github, I will merge it into the code.
Thanks. I'll look into that presently.
There are no empty strings inside the xl/sharedStrings.xml file. The closest I can find is a string with a line break inside it:
<si><t>Jason Johnson _x000D_
dwilliam_x000D_
dwilliam_x000D_
dwilliam</t></si>
Would that cause an issue?
Edit - I tried removing all the line breaks inside strings in the xl/sharedStrings.xml file, but the issue persists.
Could the issue simply be that there are too many items? The sst element has the attributescount="132871" and uniqueCount="17591".
If size was the problem, you would proabably get another type of error I would guess. I would recommend that you add some print or debug statements in the code, and try and figure out what goes wrong. I am not activly maintinging this as I no longer work in python or with excel documents. I will accept any patch you submit that fixes the issue though.
Thanks. I'll try that. If I figure out how to fix it, I'll submit a patch. I'd rather not be working with Excel documents, either (though I do enjoy working in Python).