etiennesky / profiletool

14 stars 36 forks source link

Problem with encoding with 2.16.0-Nødebo under Win 10 #15

Closed pyarchinit closed 8 years ago

pyarchinit commented 8 years ago

In Qgis 2.16 Nødebo the plugin has a problem converting to string the QGIS_VERSION variable.

I suppose It heppens by the presence of "ø" in the name.

An error has occurred while executing Python code:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 8: ordinal not in range(128) Traceback (most recent call last): File "C:/Users/Luca/.qgis2/python/plugins\profiletool\profileplugin.py", line 90, in run if self.checkIfOpening() == False: File "C:/Users/Luca/.qgis2/python/plugins\profiletool\profileplugin.py", line 216, in checkIfOpening ver = str(QGis.QGIS_VERSION) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 8: ordinal not in range(128)

Versione Python: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] Versione di QGIS: 2.16.0-Nødebo Nødebo, d0b3e39

buddiebubba commented 8 years ago

The problem is in checkIfOpening. Quick workaround to get back to work: Edit profileplugin.py by changing ver = str(QGis.QGIS_VERSION) to ver = '2.14.0'#str(QGis.QGIS_VERSION).

borysiasty commented 8 years ago

Thanks guys! It's now fixed in commit bb9f13c953c0. I have a problem with uploading the new version to the repository, so please be patient :)