Opening .xlsx on OS X crashes

Issue #925 resolved
Jerry Magill
created an issue

Trying to open a Excel workbook but I get an instant crash:

  workbook = load_workbook(datafile)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/reader/excel.py", line 274, in load_workbook
    for c in find_charts(archive, rel.target):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/chart/reader.py", line 43, in find_charts
    drawing = SpreadsheetDrawing.from_tree(tree)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/serialisable.py", line 83, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/serialisable.py", line 83, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/serialisable.py", line 83, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/serialisable.py", line 83, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/serialisable.py", line 83, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/serialisable.py", line 99, in from_tree
    return cls(**attrib)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/drawing/shapes.py", line 147, in __init__
    self.prst = prst
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl-2.5.0b1-py2.7.egg/openpyxl/descriptors/base.py", line 41, in __set__
    if not isinstance(value, self.expected_type):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

Code to reproduce bug:

from openpyxl import load_workbook

workbook = load_workbook("ucaas-datacollection.xlsx")

See workbook in attachment.

Many thanks.

Comments (4)

  1. CharlieC

    Thanks for the report. Looks like the problem is that openpyxl is trying to read the drawings on the first sheet. As support for DrawingML is incomplete this is causing an error.

  2. Log in to comment