1.8.2 crashes when trying to find dimension

Issue #260 resolved
David Laudy created an issue
File "c:\condor\execute\dir_4964\visions_solve7favlk\Model\visions\xlgdx.py", line 196, in read
    self.workbook = openpyxl.load_workbook(self._filename, use_iterators=True, data_only=True)
  File "c:\condor\execute\dir_4964\visions_solve7favlk\Model\openpyxl\openpyxl\reader\excel.py", line 136, in load_workbook
    _load_workbook(wb, archive, filename, use_iterators, keep_vba)
  File "c:\condor\execute\dir_4964\visions_solve7favlk\Model\openpyxl\openpyxl\reader\excel.py", line 203, in _load_workbook
  File "c:\condor\execute\dir_4964\visions_solve7favlk\Model\openpyxl\openpyxl\reader\worksheet.py", line 310, in read_worksheet
    xml_source, string_table, style_table)
  File "c:\condor\execute\dir_4964\visions_solve7favlk\Model\openpyxl\openpyxl\reader\iter_worksheet.py", line 136, in __init__
    min_col, min_row, max_col, max_row = read_dimension(xml_source=self.xml_source)
  File "c:\condor\execute\dir_4964\visions_solve7favlk\Model\openpyxl\openpyxl\reader\worksheet.py", line 78, in read_dimension
    start, stop = span.split(":")
AttributeError: 'NoneType' object has no attribute 'split'

Comments (18)

  1. CharlieC

    I can confirm this and can put a fix in the 1.8 / 1.9 branches. It looks like your worksheet has no dimensions so reading it will take a bit longer.

  2. CharlieC
    • changed status to open

    This file is unreadable if lxml is installed. Needs further investigation. Where is the file coming from?

  3. CharlieC

    There is a problem with a BOM at the start of the file:

    <U+FEFF><?xml version="1.0" encoding="utf-8" standalone="yes"?>

    Is it possible to get the utility to save the file without the BOM? BTW. can you try the code from the 1.8 branch and see if it solves your problem?

    That BOM is for UTF-16 so the files are being incorrectly generated.

  4. CharlieC

    @dlaudy Sorry, no. The lxml thing is a bit of a red herring. We have to use lxml when developing openpyxl. This caused problems because the files you are passing in are not correct. That will be fixed when the next version of lxml is released. We're still evaluating the use of lxml in the project.

    We will probably be releasing a version of openpyxl which will address your problem.

  5. David Laudy reporter

    Charlie, I see that the bug is resolved. Can you point me a version I could use? Thanks! David

  6. CharlieC

    We certainly will do a 1.8.4 but please also try the 1.9 branch to see if you can work with that approach.

  7. Log in to comment