Sharpie / qgis-ipython

An IPython console for Quantum GIS
4 stars 3 forks source link

UnicodeDecodeError with mapRenderer #5

Open JamesZDonline opened 7 years ago

JamesZDonline commented 7 years ago

Using QGIS 2.18.7 on Ubuntu 16.04 when trying to create a mapRenderer object the function throws a UnicodeDecodeError. This does not occur in the standard python console.

printCanvas = QgsMapCanvas() 
mymapRenderer = printCanvas.mapRenderer()

yields

"/usr/lib/python2.7/dist-packages/qgis/utils.pyc in showWarning(message, category, filename, lineno, file, line)
     77         decoded_filename = filename
     78     QgsMessageLog.logMessage(
---> 79         u"warning:{}\ntraceback:{}".format(warnings.formatwarning(message, category, decoded_filename, lineno), stk),
     80         QCoreApplication.translate("Python", "Python warning")
     81     )

/usr/lib/python2.7/warnings.pyc in formatwarning(message, category, filename, lineno, line)
     62             except UnicodeDecodeError:
     63                 pass
---> 64     s = "%s:%s" % (filename, s)
     65     return s
     66 

UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 90: ordinal not in range(128)
Sharpie commented 7 years ago

A lot of change has happened with both QGIS and IPython since I was working on this 5 years ago --- I would expect quite a few things to be broken by this point.

My day job is no longer in the GIS space, so I'd recommend looking for a different ipython plugin or starting a new project if there isn't a good plugin available. You're welcome to fork this one as a starting point!