[PyQt] Python Aborted (core dumped) error

John Thorp jat63 at blueyonder.co.uk
Sat Aug 1 15:19:38 BST 2015


I am having issues with python crashing when exceptions are raised 
inside a QTimer callback. Below is a small example showing this

import sys
from PyQt5.QtCore import (QTimer, pyqtSlot)
from PyQt5.QtWidgets import (QMainWindow, QApplication)

class MainWindow (QMainWindow):

     def __init__(self):
         QMainWindow.__init__(self)

         self.timer = QTimer(self)
         self.timer.timeout.connect(self.timer_call)
         self.timer.start(1000)

     @pyqtSlot()
     def timer_call(self):
         print ("Called")
         x={}
         x[2]

app = QApplication(sys.argv)
main = MainWindow()
main.show()

sys.exit(app.exec_())

When run this shows the following:

Called Traceback (most recent call last): File "gtscan.py", line 21, in 
timer_call x[2] KeyError: 2
Aborted (core dumped)

Version of software used are (all from Arch Linux builds):

Python 3.4.3
Qt version: 5.5.0
PyQt version: 5.5
SIP version: 4.16.9

Can anyone help this please - it is not the KeyError I am looking for 
help on - it is why this causes the python Aborted (core dumped) error.

John


More information about the PyQt mailing list