enricofer / go2streetview

22 stars 22 forks source link

IOError due to print statements when python console not visible #29

Closed dwsilk closed 7 years ago

dwsilk commented 7 years ago

I get a sporadic IOError from this plugin on Windows if I don't have the python console open in QGIS, due to print statements in the code.

An error has occurred while executing Python code: 
IOError: [Errno 9] Bad file descriptor 
Traceback (most recent call last):
  File "C:/Users/<username>/.qgis2/python/plugins\go2streetview\go2streetview.py", line 672, in canvasReleaseEvent
    self.openSVDialog()
  File "C:/Users/<username>/.qgis2/python/plugins\go2streetview\go2streetview.py", line 693, in openSVDialog
    print QUrl(self.gswDialogUrl).toString()
IOError: [Errno 9] Bad file descriptor

The issue is the same as the one described here: https://gis.stackexchange.com/questions/228631/qgis-qgis2web-ioerror-errno-9-bad-file-descriptor I'll submit a pull request that replaces the print statements with QgsMessageLog.logMessage().