makepy generates a bad format IID for a vtable function returning an object...
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
makepy generates a bad format IID for a vtable function returning an object derived from IDispatch.
It generated this line (for example):
(( u'WaitComplete' , u'request' , ), 5, (5, (), [ (16393, 10, None, "IID('{19B26BC8-9E3A-4321-B965-8ECC5F4670A4}')") , ], 1 , 1 , 4 , 0 , 44 , (3, 0, None, None) , 0 , )),
but the IID portion is in double-quotes, so it is a string. When processed by PyWinObject_AsIID, the string cannot be converted into a valid IID and becomes IID_NULL, which then fails when the returned object's QueryInterface is called with IID_NULL.
The bug seems to be in genpy's VTableItem.WriteVTableMap where it writes repr(arg[3]) instead of just arg[3].
This happens in v219 and v220 in Python 2.7, 32-bit.