Openpyxl Error in descriptors/serializable.py: __init__() got an unexpected keyword argument

Issue #616 resolved
Avery Uslaner created an issue

I'm getting this error in my script while trying to load_workbook(). My stack trace is as follows:

Traceback (most recent call last):
  File "seed_list.py", line 54, in <module>
    main()
  File "seed_list.py", line 49, in main
    parse_xlsx(wb)
  File "seed_list.py", line 17, in parse_xlsx
    project_wb = openpyxl.load_workbook("files/" + file)
  File "/home/developer/Python/RBG/lib/python3.4/site-packages/openpyxl/reader/excel.py", line 249, in load_workbook
    read_comments(new_ws, archive.read(comments_file))
  File "/home/developer/Python/RBG/lib/python3.4/site-packages/openpyxl/comments/reader.py", line 21, in read_comments
    comments = CommentSheet.from_tree(root)
  File "/home/developer/Python/RBG/lib/python3.4/site-packages/openpyxl/descriptors/serialisable.py", line 78, in from_tree
    return cls(**attrib)
TypeError: __init__() got an unexpected keyword argument '{http://schemas.openxmlformats.org/markup-compatibility/2006}Ignorable'

The file was originally in .xls format and was converted using the command:

libreoffice --convert-to xlsx *.xls --headless

Original file is attached.

Comments (6)

  1. CharlieC

    I cannot replicate the problem with the file and suggested conversion via LibreOffice. This could be down to different versions of LibreOffice. Please make sure you're using the most recent one and provide the file as converted by it.

  2. Avery Uslaner reporter

    Well I was using version 4.3.3-2+deb8u2 of Libreoffice since that seems to be the latest version available from the Debian repository. I'll grab the newest version from their website and see if that solves it for me.

  3. CharlieC

    While I can now replicate the problem with these files with openpyxl 2.3, I cannot open either of them with Microsoft Excel, though I think this is a separate issue related to the way LibreOffice copies the embedded image thus creating a much larger file and, therefore, cannot recommend this kind of conversion.

    The problem itself is related to an alternative representation of comments, which has never been adopted. I would recommend a bug report to LibreOffice regarding this conversion.

    The problem is, however, resolved with the 2.4 branch and will not be backported.

  4. Log in to comment