[GRASS-SVN] r45550 - grass/trunk/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 4 11:10:57 EST 2011


Author: martinl
Date: 2011-03-04 08:10:56 -0800 (Fri, 04 Mar 2011)
New Revision: 45550

Modified:
   grass/trunk/lib/python/core.py
Log:
#1295 (Wx location wizard fails to create location if it's title
contains non-latin letters) - write MYNAME using encoding utf-8


Modified: grass/trunk/lib/python/core.py
===================================================================
--- grass/trunk/lib/python/core.py	2011-03-04 16:05:06 UTC (rev 45549)
+++ grass/trunk/lib/python/core.py	2011-03-04 16:10:56 UTC (rev 45550)
@@ -31,6 +31,7 @@
 import subprocess
 import shutil
 import locale
+import codecs
 
 # i18N
 import gettext
@@ -1017,8 +1018,9 @@
             raise ScriptException(repr(error))
 
     try:
-        fd = open(os.path.join(dbase, location,
-                               'PERMANENT', 'MYNAME'), 'w')
+        fd = codecs.open(os.path.join(dbase, location,
+                                      'PERMANENT', 'MYNAME'),
+                         encoding = 'utf-8', mode = 'w')
         if desc:
             fd.write(desc + os.linesep)
         else:



More information about the grass-commit mailing list