[GRASS-SVN] r45551 - grass/branches/develbranch_6/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 4 11:13:43 EST 2011


Author: martinl
Date: 2011-03-04 08:13:43 -0800 (Fri, 04 Mar 2011)
New Revision: 45551

Modified:
   grass/branches/develbranch_6/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
(merge r45550 from trunk)


Modified: grass/branches/develbranch_6/lib/python/core.py
===================================================================
--- grass/branches/develbranch_6/lib/python/core.py	2011-03-04 16:10:56 UTC (rev 45550)
+++ grass/branches/develbranch_6/lib/python/core.py	2011-03-04 16:13:43 UTC (rev 45551)
@@ -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