theorchard / openpyxl

Other
58 stars 21 forks source link

Error on iter_rows(min_row=2)) on worksheet with only one row #22

Open truephelle opened 1 year ago

truephelle commented 1 year ago

Iterating by rows on worksheet with only one row

from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws.append([1])
ws.freeze_panes = ws['B2']
for seq, row in enumerate(ws.iter_rows(min_row=2), start=2):
    print(seq)

prints me 2, but i expect to raise StopIteration by iter_rows() generator.