Bug report #9175

[processing] scripts with non ascii character can't be saved

Added by Regis Haubourg almost 6 years ago. Updated over 4 years ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17805

Description

Adding a non ascii character in a script content fails on load, even with declaring # coding: iso-8859-1 on first line.

error log:

Une erreur est apparue lors de l'exécution du code Python :

Traceback (most recent call last):
  File "F:\\Outils\\QGISDEV\\CONF_QGIS_MASTER/python/plugins\\processing\\gui\\ScriptEditorDialog.py", line 121, in save
    self.saveScript(False)
  File "F:\\Outils\\QGISDEV\\CONF_QGIS_MASTER/python/plugins\\processing\\gui\\ScriptEditorDialog.py", line 152, in saveScript
    fout.write(text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe8' in position 429: ordinal not in range(128)

Version de Python :
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

Version de QGIS :
2.1.0-Master Master, unknown

Chemin vers Python : ['F:\\\\Outils\\\\QGISDEV\\\\CONF_QGIS_MASTER/python/plugins\\\\processing', 'C:/PROGRA~2/QGISTE~1/apps/qgis/./python', u'F:\\\\Outils\\\\QGISDEV\\\\CONF_QGIS_MASTER/python', u'F:\\\\Outils\\\\QGISDEV\\\\CONF_QGIS_MASTER/python/plugins', 'C:/PROGRA~2/QGISTE~1/apps/qgis/./python/plugins', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\bin\\\\python27.zip', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\DLLs', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\plat-win', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\lib-tk', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\qgis\\\\bin', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\PIL', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32\\\\lib', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\Pythonwin', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\Shapely-1.2.18-py2.7-win32.egg', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\wx-2.8-msw-unicode', 'F:\\\\Outils\\\\QGISDEV\\\\CONF_QGIS_MASTER\\\\python\\\\plugins\\\\mmqgis/forms', 'F:\\\\Outils\\\\QGISDEV\\\\CONF_QGIS_MASTER\\\\python\\\\plugins\\\\DigitizingTools\\\\tools', 'C:\\\\PROGRA~2\\\\QGISTE~1\\\\apps\\\\qgis\\\\python\\\\plugins\\\\fTools\\\\tools', 'F:/Projets/DER/IMPACT_PLANDO_CUMULE_2013/Suivi_stage_Nadine/Rendu_Stage']

Cheers,

Associated revisions

Revision d04239d7
Added by Salvatore Larosa almost 6 years ago

[processing] small fix for non-ascii string (fixes #9175)

History

#1 Updated by Salvatore Larosa almost 6 years ago

  • Status changed from Open to Closed

#2 Updated by Giovanni Manghi over 4 years ago

  • Category changed from 94 to Processing/Core

Also available in: Atom PDF