I'm trying to load an Icon from an MBM but get:
TypeError: expected valid icon file

MBMViewer accepts the MBM file as valid and displays it's content fine and bmconv splits it fine. I have generated the file on the fly with Python code (as I want to be able to update the icons in a list).
Do I need to deviate from the standard MBM format to produce icon files? Or can I find out what is causing this error (unlikely but worth a try)?