Readonly worksheet returns empty rows as empty lists
Created originally on Bitbucket by Lord Aro (Charles Pigott)
After upgrading from 2.5.3 to 2.6.0, I found that empty rows (but only those without any formatting?) were now being returned as an empty list, rather than a list of empty cells, as was happening previously.
With a readonly workbook created and iterated like:
workbook_zip = openpyxl.load_workbook(filename, data_only=True, read_only=True)
for sheet_name in workbook_zip.sheetnames:
for row in workbook_zip[sheet_name]:
print(row)
I traced this back to the top of _get_row in worksheet/_read_only.py, which bypasses the following logic that pads the row with empty cells:
if not row:
return ()
But it's not clear where to go from there - whether the issue is in the handling of the empty row, or the parser that produced it
I'm not entirely sure if this wasn't an intentional change, but it's a breaking change that wasn't mentioned in the changelog, so...