Search code examples
python-3.xwarningsopenpyxlsuppress-warnings

How to supress UserWarings in Openpyxl


I get the UserWarning 'C:\Users...\Anaconda3\lib\site-packages\openpyxl\reader\drawings.py:58: UserWarning: wmf image format is not supported so the image is being dropped warn(msg)' How can I suppress this warning message?


Solution

  • stovfl answered this question:

    To add WMF read or write support to your application, use PIL.WmfImagePlugin.register_handler() to register a WMF handler. You have to patch openpyxl as well, dropping WMF is hardcoded, see OpenPyXL - find_images

    answer