Odd parse_fills Error
Created originally on Bitbucket by tylerturk (Tyler Turk)
Hey Eric,
Firstly, I want to thank you for the time you've spent coding out this module. My team and I use it fairly heavily, and I am incredibly grateful that this was available when I started working on a particular project at work. That being said, there is an oddity when data is copy/pasted from an xlsb file in to an xlsx file where some fill attribute is copied over. I haven't dug too deeply in to what causes it, but it results in the following traceback:
#!python
File "/usr/lib/python2.6/site-packages/openpyxl-1.6.1-py2.6.egg/openpyxl/reader/excel.py", line 115, in load_workbook
_load_workbook(wb, archive, filename, use_iterators)
File "/usr/lib/python2.6/site-packages/openpyxl-1.6.1-py2.6.egg/openpyxl/reader/excel.py", line 138, in _load_workbook
style_table = read_style_table(archive.read(ARC_STYLE))
File "/usr/lib/python2.6/site-packages/openpyxl-1.6.1-py2.6.egg/openpyxl/reader/style.py", line 43, in read_style_table
fill_list = parse_fills(root, xmlns, color_index)
File "/usr/lib/python2.6/site-packages/openpyxl-1.6.1-py2.6.egg/openpyxl/reader/style.py", line 183, in parse_fills
newFill.fill_type = patternFill.get('patternType')
AttributeError: 'NoneType' object has no attribute 'get'
To resolve this, I did a simple hack as I'm not particularly concerned about the fill. I'm not sure if this is relevant as you are a few versions ahead now, but I just wanted to bring this to your attention as something to possibly look in to. Thanks again!