ValueError: min() arg is an empty sequence
Created originally on Bitbucket by Anerach (Arno)
Since version 2.6.2 I've been having issues when loading workbooks.
Whenever I try to load a file I get the following error:
Traceback (most recent call last):
File "C:/PATH_TO_PROJECT/main.py", line 608, in <module>
writeCalculatedOffenseFields(closeReason, useCaseFrequency)
File "C:/PATH_TO_PROJECT/main.py", line 420, in writeCalculatedOffenseFields
wb = load_workbook(filename='FILENAME.xlsx')
File "C:\PATH_TO_PROJECT\venv\lib\site-packages\openpyxl\reader\excel.py", line 312, in load_workbook
reader.read()
File "C:\PATH_TO_PROJECT\venv\lib\site-packages\openpyxl\reader\excel.py", line 274, in read
self.read_worksheets()
File "C:\PATH_TO_PROJECT\venv\lib\site-packages\openpyxl\reader\excel.py", line 249, in read_worksheets
charts, images = find_images(self.archive, rel.target)
File "C:\PATH_TO_PROJECT\venv\lib\site-packages\openpyxl\reader\drawings.py", line 39, in find_images
chart = read_chart(cs)
File "C:\PATH_TO_PROJECT\venv\lib\site-packages\openpyxl\chart\reader.py", line 38, in read_chart
chart.idx_base = min(s.idx for s in chart.series)
ValueError: min() arg is an empty sequence
This seems to be related to the changes made in https://bitbucket.org/openpyxl/openpyxl/commits/1b59bcb633e6166cd5d9fd21ce9731cd72a70f31
I think it happens when chart.series is empty in chart/reader.py
Attachments: min-error-repro.xlsx