Skip to content

CoClassBaseClass incorrectly sets special methods #1870

@panda-34

Description

@panda-34

There's an issue with xlwings which was introduced with pywin32 v302:
xlwings/xlwings#1789 (comment)
current implementation of win32com.client.CoClassBaseClass


injects special methods on the instance via setattr(self, '__specialmethod__')
please note, that such methods can only be called explicitly i.e. instance.__call__() but not implicitly instance() , in which case special method is always called from the class, and if the class doesn't define the method then you'll get an error (object is not callable in this case). I didn't investigate xlwings but I suppose that such implicit call produces an error which prevents release of com object from memory and creates a zombie process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions