Closed qgib closed 5 years ago
Author Name: Giovanni Manghi (@gioman)
Author Name: Alessandro Pasotti (@elpaso)
I think this is a won't fix: python printing from a thread will crash for sure.
You should use QgsMessageLog or other means to communicate with the user.
Author Name: Nyall Dawson (@nyalldawson)
It's not a regression - this has always been the case.
Author Name: Juan Manuel Perez (@juanmpd)
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).
Author Name: Alessandro Pasotti (@elpaso)
The solution is simple: do not use "print" in a python script in QGIS.
Author Name: Matthew Jackson (Matthew Jackson) Original Redmine Issue: 20558 Affected QGIS version: 3.4.1 Redmine category:pythonbindings/_sipify
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 ): QThread.init(self) def run (self): print("a message!")
t = PrintThread() t.start()