Skip to content

Fix for when Excel file being parsed does not have "properties."

Bitbucket Importer requested to merge bitbucket/declined-pr-153 into branch/default

Created originally on Bitbucket by skroth (Sean Roth)

Changesets for this Pull Request have not been imported, because it had been already declined on Bitbucket. Marked as closed by the import user.

No hard feelings if this PR is not accepted since I cannot provide a test file that this is a fix for. Basically our sales team creates Excel files that are then parsed by our system that uses openpyxl, which was failing until I made this patch. Unfortunately I can't provide a test file since every time I open and then re-save the file the error isn't seen anymore.

#!python


  File "/opt/.virtualenvs/lagapps3/local/lib/python2.7/site-packages/openpyxl/reader/excel.py", line 161, in load_workbook
    parser.parse()
  File "/opt/.virtualenvs/lagapps3/local/lib/python2.7/site-packages/openpyxl/packaging/workbook.py", line 42, in parse
    if package.properties.date1904:
AttributeError: 'NoneType' object has no attribute 'date1904'

Merge request reports