parser.pivot_cashes crash
Created originally on Bitbucket by Alexey Gaydyukov (Alexey Gaidiukov)
Some history: switched from 2.4.x to 2.5.12 and now can't load an xlsx file that contain pivots. Original file is 10MB size, ~40k lines. On the 16G machine load_workbook() fails with MemoryError after ~5-10mins, on 32G machine it loads ok, although memory footprint looks excessive for 10MB input.
So I tried to remove pivot caches by unchecking "save data with file" in the pivot table options in Excel. The file became 6MB in size, and load_workbook() now fails almost immediately with:
#!python
wb = openpyxl.load_workbook(filename=xlsfile, data_only=True)
File "C:\Anaconda\lib\site-packages\openpyxl\reader\excel.py", line 224, in load_workbook
pivot_caches = parser.pivot_caches
File "C:\Anaconda\lib\site-packages\openpyxl\packaging\workbook.py", line 127, in pivot_caches
records = get_rel(self.archive, cache.deps, cache.id, RecordList)
File "C:\Anaconda\lib\site-packages\openpyxl\packaging\relationship.py", line 153, in get_rel
rel = next(deps.find(cls.rel_type))
StopIteration
Attachments: pivot_fail5.xlsx