mime type macro error with an xslm file
Created originally on Bitbucket by ptitjano
Hi, The following code produces an error with both version 2.3.5 (from archlinux package) or 2.4 from pip using python 2.7 or 3.5:
#!python
wb = load_workbook('Analyse des maitrise.xlsm', keep_vba=True)
ws = wb.get_sheet_by_name('chefs')
ws.cell(column=1, row=1, value=3.14)
wb.save('new_document.xlsm')
#!python
wb.save('new_document.xlsm')
File "/usr/lib/python2.7/site-packages/openpyxl/workbook/workbook.py", line 339, in save
save_workbook(self, filename)
File "/usr/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 268, in save_workbook
writer.save(filename)
File "/usr/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 250, in save
self.write_data()
File "/usr/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 98, in write_data
self.manifest._write(archive, self.workbook)
File "/usr/lib/python2.7/site-packages/openpyxl/packaging/manifest.py", line 167, in _write
archive.writestr(self.path, tostring(self.to_tree()))
File "/usr/lib/python2.7/site-packages/openpyxl/packaging/manifest.py", line 124, in to_tree
for ext, mime in self.extensions:
File "/usr/lib/python2.7/site-packages/openpyxl/packaging/manifest.py", line 116, in extensions
return [(ext[1:], mimetypes.types_map[ext]) for ext in sorted(exts)]
KeyError: ''
Attachments: Analyse_des_maitrise.xlsm