EmptyCell has no coordinates

Issue #1344 wontfix
stdedos created an issue

I open an xlsx MS Excel 2007-365 format file (created by LibreOffice) in ReadOnly mode.

While iterating rows and columns, I have moved a debugging entry earlier in the code.
That started crashing with:

  File "t.py", line 374, in parse
    lg.debug('%s: %s %s', cell, cell.value, cell.coordinate)
AttributeError: 'EmptyCell' object has no attribute 'coordinate'

While it may be unreasonable to create cells that don’t exist, I would assume that a “Cell” always has a coordinate (even if it doesn’t exist / is projected / is dummy)

Comments (1)

  1. CharlieC

    This is by design: there is only ever once instance of an EmptyCell in a worksheet. This signficantly improves performance and means we have to worry less about counters.

  2. Log in to comment