PyQt5 crash instead of erroring

0

After re installing my machine, I've started to have python crashes while using Qt. It seems that when I create a button that runs some code, something that should throw an error crashes instead of erroring.

say for instance:

print(non_existing_var)

should produce this result:

NameError: name 'non_existing_var' is not defined

but instead in ends like this

Process finished with exit code -1073740791 (0xC0000409)

if instead I simply print a string, it works fine...

I've literally no idea what's going on. I've used Qt for years without ever seeing this issue. The only new thing that I'm using is the QApp for standalone that I'm not 100% sure how to use but it was working fine before I re install my machine.

Here is my code:

from PyQt5 import QtWidgets

app = QtWidgets.QApplication([])

class AppTest(QtWidgets.QWidget):
    def __init__(self):
        super(AppTest, self).__init__()

        self.main_layout = QtWidgets.QVBoxLayout(self)
        self.setLayout(self.main_layout)
        self.resize(1400, 900)

        node_1_button = QtWidgets.QPushButton("create input node")
        self.main_layout.addWidget(node_1_button)
        node_1_button.clicked.connect(self._create_input_node)

    def _create_input_node(self):
        print("a random string")
        print(non_existing_var)

inst = AppTest()
inst.show()

app.exec_()

I work from PyCharm and here are the packages I have:

  • pip 20.0.2
  • PyQt5 5.14.1
  • PyQt5-sip 12.7.1
  • PyYAML 5.3
  • Qt.py 1.2.4
  • setuptools 45.2.0
  • wheel 0.34.2

Any idea?

python
crash
pycharm
pyqt5
asked on Stack Overflow Mar 1, 2020 by Goffer • edited Mar 1, 2020 by eyllanesc

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0