[PyQt] pyqtWrapperType not usable as metaclass in 4.12?

Phil Thompson phil at riverbankcomputing.com
Tue Jun 27 18:38:59 BST 2017


On 25 Jun 2017, at 10:09 am, Georg Brandl <g.brandl at fz-juelich.de> wrote:
> 
> Hi all,
> 
> after updating PyQt4/sip to 4.12/4.19, this snippet produces a segfault
> (I've reproduced this with two builds, one built for Ubuntu, one on Mac):
> 
> 
> import PyQt4.QtCore
> 
> class D(object):
>    __metaclass__ = PyQt4.QtCore.pyqtWrapperType
> 
> 
> Is pyqtWrapperType not supposed to be instantiable anymore?
> 
> The fault occurs in pyqtWrapperType_init.  A diff between 4.11.4 and 4.12
> shows this change in the function:
> 
> -    pyqt4ClassTypeDef *pyqt_td = (pyqt4ClassTypeDef *)((sipWrapperType
> *)self)->type;
> +    const pyqt4ClassPluginDef *pyqt_td = reinterpret_cast<const
> pyqt4ClassPluginDef *>(sipTypePluginData(((sipWrapperType *)self)->wt_td));

I think this is already fixed in the current snapshot (below is the relevant patch).

As this is a regression I'm happy to release the current snapshot as v4.12.1.

Phil

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PyQt4.patch
Type: application/octet-stream
Size: 1453 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170627/677d7403/attachment.obj>


More information about the PyQt mailing list