worksheet.rows returns an empty tuple

Issue #1151 resolved
Chris Adams
created an issue

I noticed a dangerous regression in some code which accidentally upgraded from 2.5.12 to 2.6.0a1:

    wb = load_workbook(filename=filename)

    for worksheet in wb.worksheets:
        rows = worksheet.rows

With 2.5, rows will contain the data. With 2.6.0a1 rows will be an empty tuple, so code which attempts to handle empty sheets will silently miss data.

(source https://github.com/LibraryOfCongress/concordia/blob/master/importer/utils/excel.py#L10-L15)

Comments (2)

  1. Log in to comment