[PyQt] [Bug Report] SIGSEGV in simple application

Marc Van Daele marc.van.daele90 at gmail.com
Sat Apr 22 11:57:37 BST 2017


Hello,

The following Python (2.7) application results in a SIGSEGV in the last
line.
Unfortunately, I don't understand why.
I guess that the Foo() object is deleted too early, although similar
constructs (in the OK section of the program) work just fine.

from PyQt4 import QtCore
import faulthandler


class Foo(QtCore.QObject):
    sig_value_changed = QtCore.pyqtSignal(object)
    a_list = []

    def bar(self):
        print("bar")


# OK
faulthandler.enable()
Foo().bar()
x = Foo()
x.sig_value_changed.connect(lambda: None)
Foo().a_list.append("x")

# SIGSEGV
Foo().sig_value_changed.connect(lambda: None)


Is this a bug? Or am I missing something?

Thanks in advance,

Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170422/1ada675b/attachment.html>


More information about the PyQt mailing list