#5 No handlers could be found for logger "comtypes._comobject"


After updating to comtypes 0.5.1 from 0.4.2, some client code utilizing callbacks is now not working and I get the mysterious message:

No handlers could be found for logger "comtypes._comobject"

I suspect some exception is occurring behind the scenes that was meant to be logged using the logging module, but apparently, the logging scheme is broken too?


  • Nobody/Anonymous

    Logged In: NO

    Sorry, I did not mean for this be an anonymous post -- Submitted by markhirota :D

  • Thomas Heller

    Thomas Heller - 2008-08-27

    Logged In: YES
    Originator: NO

    Yes, this happens when the comtypes logger tries to log a message with level ERROR or higher, and the logging module is not configured.

    It can be avoided by calling 'import logging; logging.basicConfig()' before importing comtypes or configure the logging in some other way.

    Anyway, I have changed comtypes in SVN (revision 398) so that a NULL handler is added to the comtypes logger. This will suppress the message you mention, but should preserve full flexibility for the comtypes user.

  • Thomas Heller

    Thomas Heller - 2008-08-27
    • assigned_to: nobody --> theller
    • status: open --> closed-fixed
  • Mark Hirota

    Mark Hirota - 2008-08-28

    Logged In: YES
    Originator: NO

    Okay, I did this and got some errors being logged that seemed to indicate I no longer need a "this" parameter on the callback methods. Snippet of code from the example on the website:

    def AppEvents_WorkbookOpen(self, this, workbook):

    Should change to:

    def AppEvents_WorkbookOpen(self, workbook):



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks