Bug report #20558
QGIS crashes when printing to console in separate thread
|Category:||Python bindings / sipify|
|Affected QGIS version:||3.4.1||Regression?:||No|
|Operating System:||Windows 10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||wontfix|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||28378|
If you run the following in the python console from QGIS 3.x in Windows 10, QGIS will crash every time. I believe this is a regression that began with 3.0, but I no longer have a 2.x version to compare with.
class PrintThread (QThread):
completed = pyqtSignal()
def init(self ):
def run (self):
t = PrintThread()
#4 Updated by Juan Manuel Perez over 1 year ago
Just tried the above code on QGis 2.18.20, and in 2.18 this piece of code didn't cause QGis to crash.
I stumbled on this issue while migrating a processing pluging from Qgis 2.18 to Qgis 3.4. Its processing algorithm included some 'print' statements, and I've been forced to remove them for Qgis3 (in Qgis2 they didn't cause any problems).