Error opening xlsx, __init__() got an unexpected keyword argument 'fLocksText'

Issue #1106 resolved
Anna Coleman
created an issue

Strange error on load_workbook(), win 10 x64, python 3.7, openpyxl==2.5.8:

wb = load_workbook(input_file)
  File "D:\Miniconda3\lib\site-packages\openpyxl-2.5.8-py3.7.egg\openpyxl\reader\excel.py", line 276, in load_workbook
    for c in find_charts(archive, rel.target):
  File "D:\Miniconda3\lib\site-packages\openpyxl-2.5.8-py3.7.egg\openpyxl\chart\reader.py", line 50, in find_charts
    drawing = SpreadsheetDrawing.from_tree(tree)
  File "D:\Miniconda3\lib\site-packages\openpyxl-2.5.8-py3.7.egg\openpyxl\descriptors\serialisable.py", line 84, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "D:\Miniconda3\lib\site-packages\openpyxl-2.5.8-py3.7.egg\openpyxl\descriptors\serialisable.py", line 84, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "D:\Miniconda3\lib\site-packages\openpyxl-2.5.8-py3.7.egg\openpyxl\descriptors\serialisable.py", line 100, in from_tree
    return cls(**attrib)
TypeError: __init__() got an unexpected keyword argument 'fLocksText'

Comments (5)

  1. Anna Coleman reporter

    2.5.0 - error

    2.4.11 - works, so, for googlers, temp solution for this (if your file don't need 2.5-2.6 functionality):

    pip uninstall openpyxl
    conda uninstall openpyxl
    pip install openpyxl==2.4.11
    
  2. CharlieC

    Thanks for the report and the file. The problem is related to a shape in the worksheet. 2.5 and later try to load images and charts but earlier versions don't which is why you're seeing the behaviour you are.

  3. Log in to comment