load_workbook failed

Issue #754 resolved
Xiaowei Zhang
created an issue

File "C:\Python27\lib\site-packages\openpyxl\reader\excel.py", line 225, in load_workbook
ws_parser.parse()

File "C:\Python27\lib\site-packages\openpyxl\reader\worksheet.py", line 126, in parse
obj = prop[1].from_tree(element)

File "C:\Python27\lib\site-packages\openpyxl\descriptors\serialisable.py", line 76, in from_tree
obj = desc.expected_type.from_tree(el)

File "C:\Python27\lib\site-packages\openpyxl\descriptors\serialisable.py", line 76, in from_tree
obj = desc.expected_type.from_tree(el)

File "C:\Python27\lib\site-packages\openpyxl\descriptors\serialisable.py", line 89, in from_tree
return cls(**attrib)

File "C:\Python27\lib\site-packages\openpyxl\worksheet\filters.py", line 263, in init
self.filter = filter

File "C:\Python27\lib\site-packages\openpyxl\descriptors\sequence.py", line 27, in set
seq = [_convert(self.expected_type, value) for value in seq]

File "C:\Python27\lib\site-packages\openpyxl\descriptors\base.py", line 59, in _convert
raise TypeError('expected ' + str(expected_type))

TypeError: expected <type 'str'>

Comments (7)

  1. Xiaowei Zhang reporter

    With version 2.4.1, I met the issue while opening the excel file. And refer to bug #663, I changed in filters.py
    from:
    filter = ValueSequence(expected_type=str)
    to:
    filter = ValueSequence(expected_type=basestring)

    And the issue disappears.

    Hope this would be defected and fixed in the new version.

  2. Log in to comment