segfault inheriting from an enumeration in pyqt5 (noticed via mypy stubtest)

Kyle Altendorf sda at fstab.net
Mon Nov 28 16:11:40 GMT 2022


While checking the PyQt5-stubs package with updated mypy [0] we noticed segfaults when running stubtest.  Apparently they added a feature that verifies classes not marked as final are in fact inheritable.  This triggered the segfault as noted in the mypy issue report [1].  Specifically, a file with contents as below will result in a segfault, at least in Linux with PyQt5==5.15.7

    import PyQt5.QtBluetooth
    class segfault(PyQt5.QtBluetooth.QBluetooth.AttAccessConstraint): ...

I don't know what it would take to fix this, or how much maintenance is still being done on PyQt5, but figured I'd at least bring this up.  Inheriting from this particular class does result in a sensible Python exception with PyQt6, at least.

Cheers,
-kyle

[0] https://github.com/python-qt-tools/PyQt5-stubs/pull/202
[1] https://github.com/python/mypy/issues/14196#issuecomment-1328115190


More information about the PyQt mailing list