[QGIS Commit] r14571 - trunk/qgis/python

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Nov 12 13:54:06 EST 2010


Author: wonder
Date: 2010-11-12 10:54:06 -0800 (Fri, 12 Nov 2010)
New Revision: 14571

Modified:
   trunk/qgis/python/utils.py
Log:
Handle non-ascii characters in traceback when showing an exception


Modified: trunk/qgis/python/utils.py
===================================================================
--- trunk/qgis/python/utils.py	2010-11-12 18:53:51 UTC (rev 14570)
+++ trunk/qgis/python/utils.py	2010-11-12 18:54:06 UTC (rev 14571)
@@ -22,7 +22,7 @@
     msg = QCoreApplication.translate('Python', 'An error has occured while executing Python code:')
   txt = '<font color="red">%s</font><br><br>' % msg
   for s in lst:
-    txt += s
+    txt += s.decode('utf-8', 'replace')
   txt += '<br>%s<br>%s<br><br>' % (QCoreApplication.translate('Python','Python version:'), sys.version)
   txt += '<br>%s<br>%s %s, %s<br><br>' % (QCoreApplication.translate('Python','QGIS version:'), QGis.QGIS_VERSION, QGis.QGIS_RELEASE_NAME, QGis.QGIS_SVN_VERSION)
   txt += '%s %s' % (QCoreApplication.translate('Python','Python path:'), str(sys.path))



More information about the QGIS-commit mailing list